|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSim.Routing.AbstractRoutingAlgorithm
Sim.Routing.GPSR.Algorithm
public class Algorithm
Greedy Perimeter Stateless Routing (GPSR) Algorithm, based on nodes know their own locations. Uses a broadcast technique to keep 1 hop nodes up to date with locations of neighbors. Packet sending is done based on greedy, or perimeter routing. Greedy uses the node nearest to the destination location to route the packet. Because there isn't always a node closer than the originator, perimeter routing attempts to push the packet around voids in a right hand rule method.
Field Summary |
---|
Fields inherited from class Sim.Routing.AbstractRoutingAlgorithm |
---|
myNode |
Constructor Summary | |
---|---|
Algorithm()
|
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 |
newPacket(Node dest,
Packet packet)
Event when a Node wants to send a new Packet. |
void |
overheard(HardwareFrame in)
Action when a packet is overheard. |
void |
setSimulation(Simulation sim)
Configures initial events to start when the simulation starts. |
void |
terminated(HardwareFrame in)
Action when a packet has finished it's journey. |
Methods inherited from class Sim.Routing.AbstractRoutingAlgorithm |
---|
attached, getTime, loopback, scheduleEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Algorithm()
Method Detail |
---|
public void setSimulation(Simulation sim)
setSimulation
in interface RoutingAlgorithm
setSimulation
in class AbstractRoutingAlgorithm
sim
- the simulation to run with this algorithmpublic void newPacket(Node dest, Packet packet)
newPacket
in interface RoutingAlgorithm
newPacket
in class AbstractRoutingAlgorithm
src
- non-null Node originating the Packet (packet.getSource() == src.getAddress())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.public void arrived(HardwareFrame in)
arrived
in interface RoutingAlgorithm
arrived
in class AbstractRoutingAlgorithm
us
- non-null Node receiving the HardwareFramein
- non-null HardwareFrame receivedpublic void overheard(HardwareFrame in)
overheard
in interface RoutingAlgorithm
overheard
in class AbstractRoutingAlgorithm
in
- the hardwareframe that is overheardpublic void terminated(HardwareFrame in)
terminated
in interface RoutingAlgorithm
terminated
in class AbstractRoutingAlgorithm
in
- hardwareframe that is at it's destination.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |