jist.swans.radio
Class RadioNoiseIndep

java.lang.Object
  extended by jist.swans.radio.RadioNoise
      extended by jist.swans.radio.RadioNoiseIndep
All Implemented Interfaces:
JistAPI.Proxiable, JistAPI.Timeless, RadioInterface

public final class RadioNoiseIndep
extends RadioNoise

RadioNoiseIndep implements a radio with an independent noise model.

Since:
SWANS1.0
Version:
$Id: RadioNoiseIndep.java,v 1.25 2004/11/05 03:38:34 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu&rt;

Field Summary
protected  double thresholdSNR
          threshold signal-to-noise ratio.
 
Fields inherited from class jist.swans.radio.RadioNoise
fieldEntity, macEntity, mode, radioInfo, self, signalBuffer, signalFinish, signalPower_mW, signals
 
Constructor Summary
RadioNoiseIndep(int id, RadioInfo.RadioInfoShared sharedInfo)
          Create new radio with independent noise model.
RadioNoiseIndep(int id, RadioInfo.RadioInfoShared sharedInfo, double thresholdSNR)
          Create new radio with independent noise model.
 
Method Summary
 void endReceive(java.lang.Double powerObj_mW)
          End message reception.
 void receive(Message msg, java.lang.Double powerObj_mW, java.lang.Long durationObj)
          Start receiving message.
 void setThresholdSNR(double snrThreshold)
          Set signal-to-noise ratio.
 
Methods inherited from class jist.swans.radio.RadioNoise
endTransmit, getProxy, getRadioInfo, lockSignal, setFieldEntity, setMacEntity, setMode, setSleepMode, transmit, unlockSignal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thresholdSNR

protected double thresholdSNR
threshold signal-to-noise ratio.

Constructor Detail

RadioNoiseIndep

public RadioNoiseIndep(int id,
                       RadioInfo.RadioInfoShared sharedInfo)
Create new radio with independent noise model.

Parameters:
id - radio identifier
sharedInfo - shared radio properties

RadioNoiseIndep

public RadioNoiseIndep(int id,
                       RadioInfo.RadioInfoShared sharedInfo,
                       double thresholdSNR)
Create new radio with independent noise model.

Parameters:
id - radio identifier
sharedInfo - shared radio properties
thresholdSNR - threshold signal-to-noise ratio
Method Detail

setThresholdSNR

public void setThresholdSNR(double snrThreshold)
Set signal-to-noise ratio.

Parameters:
snrThreshold - threshold signal-to-noise ratio

receive

public void receive(Message msg,
                    java.lang.Double powerObj_mW,
                    java.lang.Long durationObj)
Start receiving message. Puts radio into receive or sensing mode depending on the message power and the state of the radio. A radio that is currently transmitting will ignore incoming messages. Called from field entity.

Parameters:
msg - incoming message
powerObj_mW - signal strength of incoming message (units: mW)
durationObj - time until end of transmission (units: simtime)

endReceive

public void endReceive(java.lang.Double powerObj_mW)
End message reception. Puts the radio back into sensing or idle mode, and sends the received message to upper layers for processing, if no error has occurred during the reception. Called from field entity.

Parameters:
powerObj_mW - signal strength of incoming message (units: mW)