|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSim.Node
public class Node
Node is the central object of the simulation, which tracks its location and keeps a RoutingAlgorithm.
Constructor Summary | |
---|---|
Node(int address,
Simulation sim,
LocationManager locationManager,
RoutingAlgorithm routingAlg,
double transmissionRange,
NodeMonitor monitor)
|
Method Summary | |
---|---|
int |
getAddress()
|
Location |
getLocation()
Returns the current location for this Node, based on the Simulation's current time. |
double |
getPowerUsed()
|
double |
getTransmissionRange()
|
void |
receiveFrame(HardwareFrame frame)
Occurs when a node receives a frame. |
void |
sendFrame(HardwareFrame frame)
Queues a HardwareFrame to be sent by this node. |
void |
sendNewPacket(Node destination,
Packet packet)
Originates a new Packet to be sent to the given destination. |
void |
sendNewPacket(Packet packet)
Originates a new Packet to be sent. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Node(int address, Simulation sim, LocationManager locationManager, RoutingAlgorithm routingAlg, double transmissionRange, NodeMonitor monitor)
Method Detail |
---|
public Location getLocation()
public int getAddress()
public double getTransmissionRange()
public double getPowerUsed()
public void receiveFrame(HardwareFrame frame)
frame
- non-null HardwareFramepublic void sendNewPacket(Node destination, Packet packet)
destination
- non-null destination Nodepacket
- non-null Packet to send, with proper addresses setpublic void sendNewPacket(Packet packet)
packet
- non-null Packet to send, with proper addresses setpublic void sendFrame(HardwareFrame frame)
frame
- non-null HardwareFrame with source address equal to this nodepublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |