jist.swans.radio
Class RadioNoiseAdditive

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

public class RadioNoiseAdditive
extends RadioNoise

RadioNoiseAdditive implements a radio with an additive noise model.

Since:
SWANS1.0
Version:
$Id: RadioNoiseAdditive.java,v 1.26 2004/11/19 15:55:34 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu&rt;

Field Summary
protected  BERTable ber
          bit-error-rate table.
static byte BER
          bit-error-rate error model constant.
static byte SNR
          signal-to-noise error model constant.
protected  float thresholdSNR
          threshold signal-to-noise ratio.
protected  double totalPower_mW
          total signal power.
protected  byte type
          radio type: SNR or BER.
 
Fields inherited from class jist.swans.radio.RadioNoise
fieldEntity, macEntity, mode, radioInfo, self, signalBuffer, signalFinish, signalPower_mW, signals
 
Constructor Summary
RadioNoiseAdditive(int id, RadioInfo.RadioInfoShared shared)
          Create new radio with additive noise model.
RadioNoiseAdditive(int id, RadioInfo.RadioInfoShared shared, BERTable ber)
          Create a new radio with additive noise model.
RadioNoiseAdditive(int id, RadioInfo.RadioInfoShared shared, float snrThreshold_mW)
          Create a new radio with additive 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 setBERTable(BERTable ber)
          Register a bit-error-rate table.
 
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

SNR

public static final byte SNR
signal-to-noise error model constant.

See Also:
Constant Field Values

BER

public static final byte BER
bit-error-rate error model constant.

See Also:
Constant Field Values

type

protected byte type
radio type: SNR or BER.


thresholdSNR

protected float thresholdSNR
threshold signal-to-noise ratio.


ber

protected BERTable ber
bit-error-rate table.


totalPower_mW

protected double totalPower_mW
total signal power.

Constructor Detail

RadioNoiseAdditive

public RadioNoiseAdditive(int id,
                          RadioInfo.RadioInfoShared shared)
Create new radio with additive noise model.

Parameters:
id - radio identifier
shared - shared radio properties

RadioNoiseAdditive

public RadioNoiseAdditive(int id,
                          RadioInfo.RadioInfoShared shared,
                          float snrThreshold_mW)
Create a new radio with additive noise model.

Parameters:
id - radio identifier
shared - shared radio properties
snrThreshold_mW - threshold signal-to-noise ratio

RadioNoiseAdditive

public RadioNoiseAdditive(int id,
                          RadioInfo.RadioInfoShared shared,
                          BERTable ber)
Create a new radio with additive noise model.

Parameters:
id - radio identifier
shared - shared radio properties
ber - bit-error-rate table
Method Detail

setBERTable

public void setBERTable(BERTable ber)
Register a bit-error-rate table.

Parameters:
ber - bit-error-rate table

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)