Rev | Line | |
---|
[31] | 1 | /************************************************************************************ |
---|
| 2 | * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University |
---|
| 3 | * All rights reserved. |
---|
| 4 | * Refer to LICENSE for terms and conditions of use. |
---|
| 5 | ***********************************************************************************/ |
---|
| 6 | package vnsim.applications.vitp.utils; |
---|
| 7 | |
---|
| 8 | import vnsim.vehicular.simulator.Location; |
---|
| 9 | |
---|
| 10 | public class Neighbor { |
---|
| 11 | private Location location; |
---|
| 12 | |
---|
| 13 | public int id; |
---|
| 14 | |
---|
| 15 | public long timestamp; //the timestamp when the neighbor |
---|
| 16 | //was detected |
---|
| 17 | |
---|
| 18 | public Location getLocation(){ |
---|
| 19 | return location; |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | // public Neighbor(Location loc) { |
---|
| 23 | // this.location=loc; |
---|
| 24 | // } |
---|
| 25 | |
---|
| 26 | public Neighbor(Location loc, int id){ |
---|
| 27 | this.location=loc; |
---|
| 28 | this.id=id; |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | public Neighbor(Location loc, int id, long timestamp) { |
---|
| 32 | this(loc,id); |
---|
| 33 | this.timestamp=timestamp; |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | public String toString() { |
---|
| 37 | String ret=""; |
---|
| 38 | ret=ret+"N:[id="+id+"Rd="+location.roadIdx+";Pt="+location.ptIdx+"]-"; |
---|
| 39 | return ret; |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | public long getTimestamp() { |
---|
| 43 | return timestamp; |
---|
| 44 | } |
---|
| 45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.