|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSim.Routing.AbstractRoutingAlgorithm
public class AbstractRoutingAlgorithm
AbstractRoutingAlgorithm is a RoutingAlgorithm implementation whose methods take no action, so that only the methods of interest can be overridden.
Field Summary | |
---|---|
protected Node |
myNode
|
Constructor Summary | |
---|---|
AbstractRoutingAlgorithm()
|
Method Summary | |
---|---|
void |
arrived(HardwareFrame in)
Event when a HardwareFrame arrives destined for this Node that does not have a user Packet, or has a Packet not for this Node. |
void |
attached(Node us)
Event called when a Node is given a RemoteAlgorithm to route packets for it. |
protected double |
getTime()
Returns the current time of the Simulation. |
void |
loopback(HardwareFrame in)
Event when a Node hears its own HardwareFrame (which is guaranteed to happen after a send completes). |
void |
newPacket(Node dest,
Packet packet)
Event when a Node wants to send a new Packet. |
void |
overheard(HardwareFrame in)
Event when a HardwareFrame is overheard by a Node (the HardwareFrame's destination is not the Node). |
void |
scheduleEvent(double t,
SimulationEvent event)
Schedules a new event to take place in the future. |
void |
setSimulation(Simulation sim)
Sets the simulation for this RoutingAlgorithm. |
void |
terminated(HardwareFrame in)
Event when a HardwareFrame arrives destined for this Node that has a user Packet that is destined for this Node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Node myNode
Constructor Detail |
---|
public AbstractRoutingAlgorithm()
Method Detail |
---|
public void setSimulation(Simulation sim)
setSimulation
in interface RoutingAlgorithm
sim
- non-null Simulationpublic void attached(Node us)
attached
in interface RoutingAlgorithm
us
- non-null Nodepublic void arrived(HardwareFrame in)
arrived
in interface RoutingAlgorithm
in
- non-null HardwareFrame receivedpublic void terminated(HardwareFrame in)
terminated
in interface RoutingAlgorithm
in
- non-null HardwareFrame receivedpublic void overheard(HardwareFrame in)
overheard
in interface RoutingAlgorithm
in
- non-null HardwareFrame receivedpublic void loopback(HardwareFrame in)
loopback
in interface RoutingAlgorithm
in
- non-null HardwareFrame received whose source equals the "us" addresspublic void newPacket(Node dest, Packet packet)
newPacket
in interface RoutingAlgorithm
dest
- non-null Node as the destination (packet.getDest() == dest.getAddress())packet
- user packet data to send, with a destination address not equal to the address for
the sending Node.protected double getTime()
public void scheduleEvent(double t, SimulationEvent event)
t
- event time greater than or equal to the current simulation timeevent
- non-null SimulationEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |