Constructor and Description |
---|
Node() |
Modifier and Type | Method and Description |
---|---|
void |
addEventToHandle(AbstractEvent ae,
int StartTime)
Add a new event to be handled by this node
|
void |
addTimer(AbstractTimer t)
Add a new timer for synchronous simulation
|
void |
addToInbox(Message m,
Node sender,
Node target,
double delayTime)
Define the actions for the step phase in synchronous simulation.
|
void |
broadcast(Message m,
double delayTime)
Send a message using broadcast.
|
int |
compareTo(Node o)
Compare two nodes.
|
boolean |
equals(Node n)
Return whether a node is equal to another using its id.
|
boolean |
equals(java.lang.Object obj)
Compare two nodes.
|
AbstractConnectivityModel |
getConectivityModel()
Return the ConnectivityModel associated with this node
|
int |
getID()
Return the nodes ID in the global network
|
Inbox |
getInbox()
Set the color for this node
|
AbstractMobilityModel |
getMobilityModel()
Return the MobilityModel associated with this node
|
AbstractNodesList |
getNeighbours() |
Position |
getPosition()
Return the node's current position
|
Runtime |
getRuntime()
Return the current runtime of the application
|
int |
getSizeInbox() |
abstract void |
handleMessages(Inbox inbox)
In synchronous simulation, this method is executed every round.
|
int |
hashCode()
Return a hashcode for this node
|
boolean |
isNeighborhoodChange() |
abstract void |
neighborhoodChange()
Overwrite this method to specify what will happen whether a node's neighbourhood changes.
|
abstract void |
onCreation()
This method is called when a new node is created.
|
abstract void |
postStep()
Method used in synchronous simulation only.
|
abstract void |
preStep()
Method used in synchronous simulation only.
|
void |
setConectivityModel(AbstractConnectivityModel conectivityModel)
Set the ConnectivityModel for this node
|
void |
setID(int id) |
void |
setInbox(Inbox inbox) |
void |
setMobilityModel(AbstractMobilityModel mobilityModel)
Set the MobilityModel for this node
|
void |
setNeighborhoodChange(boolean neighborhoodChange) |
void |
setNeighbours(AbstractNodesList neighbours) |
void |
setPosition(int posX,
int posY)
Internal use only method.Do not use this method on your projects.
|
void |
setPosition(Position pos)
Internal use only method.Do not use this method on your projects.
|
void |
setRuntime(Runtime runtime)
Set the runtime for an application
|
void |
step(long time)
The step phase for assynchronous simulation.
|
java.lang.String |
toString()
Return the string representation for this node
|
void |
unicast(Message m,
Node target,
double delayTime)
Send a message directly to a specific Node.
|
void |
updateConnection()
Update all connections of this node.
|
public Runtime getRuntime()
public void setRuntime(Runtime runtime)
runtime
- - the runtime to be applied for the simulationpublic void setPosition(int posX, int posY)
posX
- - position in the x-axisposY
- - position in the y-axispublic void setPosition(Position pos)
pos
- - the Position that the node will assumepublic int getID()
public Position getPosition()
public boolean equals(Node n)
n
- - the node to be comparedpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- - the object to be compared withpublic int hashCode()
hashCode
in class java.lang.Object
public int compareTo(Node o)
compareTo
in interface java.lang.Comparable<Node>
o
- - the node to be comparedpublic java.lang.String toString()
toString
in class java.lang.Object
public AbstractConnectivityModel getConectivityModel()
public void setConectivityModel(AbstractConnectivityModel conectivityModel)
conectivityModel
- - the connectivity model to be associated with this nodepublic AbstractMobilityModel getMobilityModel()
public void setMobilityModel(AbstractMobilityModel mobilityModel)
mobilityModel
- - the MobilityModel to be associated with this nodepublic Inbox getInbox()
color
- - the color of the nodepublic int getSizeInbox()
public void setInbox(Inbox inbox)
public AbstractNodesList getNeighbours()
public void setNeighbours(AbstractNodesList neighbours)
public boolean isNeighborhoodChange()
public void setNeighborhoodChange(boolean neighborhoodChange)
public void addTimer(AbstractTimer t)
t
- - the timer to be addedpublic void addEventToHandle(AbstractEvent ae, int StartTime)
ae
- - the AbstractEvent to be handledpublic void broadcast(Message m, double delayTime)
m
- - the message to be sentsendTime
- - the time when the message shall be sentreceiveTime
- - the time when the message shall arrivepublic void unicast(Message m, Node target, double delayTime)
m
- - the message to be senttarget
- - the target of the messagesendTime
- - the time when the message will be sentreceiveTime
- - the time when the message will be receivedpublic void addToInbox(Message m, Node sender, Node target, double delayTime)
public void step(long time)
time
- - the second to be evaluatedpublic void updateConnection()
public void setID(int id)
public abstract void handleMessages(Inbox inbox)
inbox
- - intance of Inbox. Used to retrieve all incoming messages from a node's inbox.for the calling sequence of the node methods.
public abstract void preStep()
for the calling sequence of the node methods.
public abstract void postStep()
for the calling sequence of the node methods.
public abstract void neighborhoodChange()
for the calling sequence of the node methods.
public abstract void onCreation()