|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsidnet.stack.users.marco_project.image_charges.routing.ElectrostaticRouter
public class ElectrostaticRouter
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface jist.swans.route.RouteInterface |
|---|
RouteInterface.Aodv, RouteInterface.BezierRouting, RouteInterface.Dsr, RouteInterface.ECGRIDRouting, RouteInterface.GenericRouting, RouteInterface.HeartbeatProtocol, RouteInterface.MultiTreeRouting, RouteInterface.RandomPathRouting, RouteInterface.ShortestPathRouting, RouteInterface.Zrp |
| Field Summary | |
|---|---|
int |
contorUndeliverable
|
boolean |
disconnected
|
double[] |
fieldVector
|
Coordinate |
rly
|
java.util.HashMap<java.lang.Integer,java.lang.Long> |
sequenceMap
|
Coordinate |
snk
|
static TopologyGUI |
topologyGUI
|
MacAddress |
undeliverableToMacAddress
|
| Constructor Summary | |
|---|---|
ElectrostaticRouter(Node myNode,
StatsCollector stats)
Creates a new instance of ElectrostaticRouter |
|
| Method Summary | |
|---|---|
void |
addChargeEffect(ElectricCharge e,
double[] fieldVector,
Coordinate vpl)
Applies effect of presented charge to the field vector at virtual packet position. |
double[] |
calculateFieldVector(java.util.List<ElectricCharge> charges,
Coordinate vpl,
Coordinate srcLoc)
Calculates the field vector at a virtual packet position Optionally applies method of image charges |
Coordinate |
calculateNextVPL(Coordinate currentVPL,
double[] fieldVector,
Message msg)
Based on the currentVPL location and current fieldVector coordinates, we should be able to determine the next desirable (hence virtual) VPL for the packet |
void |
drawFieldVector(Coordinate vpl,
double[] fieldVectorr)
Draws a field vector to the GUI |
void |
dropNotify(Message msg,
MacAddress nextHopMac,
Reason reason)
Notifies on message drop. |
RouteInterface |
getProxy()
internals |
void |
initFieldVectors(int routeOutgoingAngle)
Initializes the field vectors around the source node |
boolean |
isDuplicated(DataMessage dataMsg)
|
double |
maxCoverage()
Analyzes all the 1-hop neighbors and returns the distance to furthest neighbor |
void |
peek(NetMessage msg,
MacAddress lastHopMac)
NOT AVAILABLE ANYMORE. |
void |
receive(Message msg,
NetAddress src,
MacAddress lastHop,
byte macId,
NetAddress dst,
byte priority,
byte ttl)
Receives a message from the Link layer. |
int |
selectNextHop(Coordinate vpl)
Returns id of selected next-hop node |
void |
send(NetMessage netMsg)
This function is called when the App Layer transmits a packet (other than broadcast (NetAddress.ANY) packet) or a message is received from the MAC layer, but, since this node is not the FINAL destination of the message, it needs to be forwarded. |
void |
sendToAppLayer(Message msg,
NetAddress src)
convenience function to send data UP ("to app layer") |
byte |
sendToLinkLayer(NetMessage.Ip ipMsg,
NetAddress nextHopDestIP)
convenience function to send data DOWN ("to link layer") |
void |
setAppInterface(AppInterface appInterface)
internals - for hooking up with App-Layer |
void |
setNetEntity(NetInterface netEntity)
internals - for hooking up with the Network-Layer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static TopologyGUI topologyGUI
public int contorUndeliverable
public MacAddress undeliverableToMacAddress
public Coordinate rly
public Coordinate snk
public double[] fieldVector
public boolean disconnected
public java.util.HashMap<java.lang.Integer,java.lang.Long> sequenceMap
| Constructor Detail |
|---|
public ElectrostaticRouter(Node myNode,
StatsCollector stats)
myNode - | Method Detail |
|---|
public boolean isDuplicated(DataMessage dataMsg)
public void send(NetMessage netMsg)
send in interface NetInterface.NetHandlersend in interface RouteInterfacenetMsg -
public void receive(Message msg,
NetAddress src,
MacAddress lastHop,
byte macId,
NetAddress dst,
byte priority,
byte ttl)
receive in interface NetInterface.NetHandlermsg - src - lastHop - macId - dst - priority - ttl -
public void peek(NetMessage msg,
MacAddress lastHopMac)
peek in interface RouteInterfacemsg - lastHopMac -
public void dropNotify(Message msg,
MacAddress nextHopMac,
Reason reason)
dropNotify in interface NetInterface.NetHandlermsg - nextHopMac - reason -
public byte sendToLinkLayer(NetMessage.Ip ipMsg,
NetAddress nextHopDestIP)
ipMsg - nextHopDestIP -
public void sendToAppLayer(Message msg,
NetAddress src)
msg - src - public void initFieldVectors(int routeOutgoingAngle)
routeOutgoingAngle -
public void addChargeEffect(ElectricCharge e,
double[] fieldVector,
Coordinate vpl)
e - fieldVector - vpl -
public double[] calculateFieldVector(java.util.List<ElectricCharge> charges,
Coordinate vpl,
Coordinate srcLoc)
charges - vpl - srcLoc -
public Coordinate calculateNextVPL(Coordinate currentVPL,
double[] fieldVector,
Message msg)
currentVPL - fieldVector - msg -
public double maxCoverage()
public int selectNextHop(Coordinate vpl)
vpl -
public void drawFieldVector(Coordinate vpl,
double[] fieldVectorr)
vpl - fieldVectorr - public void setAppInterface(AppInterface appInterface)
appInterface - public void setNetEntity(NetInterface netEntity)
netEntity - public RouteInterface getProxy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||