|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.tinyos.sim.script.reflect.SimReflect | +--net.tinyos.sim.script.reflect.Radio
Interface class to the radio model.
The class is bound into the simcore module as the radio global instance.
Constructor Summary | |
---|---|
Radio(net.tinyos.sim.script.ScriptInterpreter interp,
net.tinyos.sim.SimDriver driver)
|
Method Summary | |
---|---|
void |
disable()
Disables the radio model plugin altogether. |
double |
distanceToPacketLoss(double distance)
Convert a distance into a packet loss probability according to the current radio model. |
double |
distanceToPacketLoss(double distance,
java.lang.String model)
Convert a distance into a packet loss probability according to the specified radio model. |
void |
enable()
Re-enables the radio model plugin. |
java.lang.String |
getCurModel()
Return the name of the current radio model. |
double |
getLossRate(int senderID,
int receiverID)
Get the packet loss rate between two motes. |
double |
getScalingFactor()
Return the radio model scaling factor. |
double |
packetLossToBitError(double packetLoss)
Convert a requested packet loss probability into a bit error rate, according to the current radio model. |
double |
packetLossToBitError(double packetLoss,
java.lang.String model)
Convert a requested packet loss probability into a bit error rate, according to the specified radio model. |
void |
printLossRates()
Dump the current loss rate table to the console. |
void |
publishModel()
Publishes all the current radio model values to the simulator. |
void |
setAutoPublish(boolean autoPublish)
Set the auto publish flag in the radio model. |
void |
setCurModel(java.lang.String modelname)
Set the radio model. |
void |
setLossRate(int senderID,
int receiverID,
double prob)
Set the packet loss rate between two motes. |
void |
setScalingFactor(double scalingFactor)
Set the radio model scaling factor. |
void |
updateModel()
Forces a recalculation of the radio loss model by iterating over all pairs of motes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Radio(net.tinyos.sim.script.ScriptInterpreter interp, net.tinyos.sim.SimDriver driver)
Method Detail |
public java.lang.String getCurModel()
public void setCurModel(java.lang.String modelname)
modelname
- the name of the new model (e.g. "empirical")public double getScalingFactor()
public void setScalingFactor(double scalingFactor)
scalingFactor
- the new scaling factorpublic double getLossRate(int senderID, int receiverID)
senderID
- id of the sender motereceiverID
- id of the receiver motepublic void setLossRate(int senderID, int receiverID, double prob)
senderID
- id of the sender motereceiverID
- id of the receiver moteprob
- new loss probabilitypublic void printLossRates()
public double packetLossToBitError(double packetLoss)
packetLoss
- requested packet loss probabilitypublic double packetLossToBitError(double packetLoss, java.lang.String model)
packetLoss
- requested packet loss probabilitymodel
- name of the radio model to usepublic double distanceToPacketLoss(double distance)
distance
- the distance between two motespublic double distanceToPacketLoss(double distance, java.lang.String model)
distance
- the distance between two motesmodel
- name of the radio model to usepublic void setAutoPublish(boolean autoPublish)
autoPublish
- value of the autoPublish featurepublic void updateModel()
public void publishModel()
public void disable()
public void enable()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |