avrora.sim.radio.freespace
Class FreeSpaceAir

java.lang.Object
  extended byavrora.sim.radio.freespace.FreeSpaceAir
All Implemented Interfaces:
RadioAir

public class FreeSpaceAir
extends java.lang.Object
implements RadioAir

Implementation of the free space radio propagation model


Nested Class Summary
protected  class FreeSpaceAir.MeetEvent
           
 
Field Summary
static int bitPeriod
           
static int bitPeriod2
           
static int bytePeriod
          The amount of cycles it takes for one byte to be sent.
protected  java.util.HashSet radios
           
 
Constructor Summary
FreeSpaceAir(Topology top)
          new free space air
 
Method Summary
 void addRadio(Radio r)
          The addRadio() method adds a new radio to this radio model.
 Synchronizer getSynchronizer()
          The getSynchronizer() method gets the synchronizer for this air implementation.
 byte readChannel(Radio r)
          The readChannel() method reads the value of the channel at the current time so that the last 8 bits transmitted (where the bits are 0 if there are no transmissions) are returned.
 void removeRadio(Radio r)
          remove radio
 int sampleRSSI(Radio r)
          see simple air for more
 void transmit(Radio r, Radio.Transmission f)
          transmit packet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radios

protected final java.util.HashSet radios

bytePeriod

public static final int bytePeriod
The amount of cycles it takes for one byte to be sent.

See Also:
Constant Field Values

bitPeriod

public static final int bitPeriod
See Also:
Constant Field Values

bitPeriod2

public static final int bitPeriod2
See Also:
Constant Field Values
Constructor Detail

FreeSpaceAir

public FreeSpaceAir(Topology top)
new free space air

Method Detail

addRadio

public void addRadio(Radio r)
Description copied from interface: RadioAir
The addRadio() method adds a new radio to this radio model.

Specified by:
addRadio in interface RadioAir
Parameters:
r - the radio to add to this air implementation

removeRadio

public void removeRadio(Radio r)
remove radio

Specified by:
removeRadio in interface RadioAir
Parameters:
r - the radio to remove from this air implementation
See Also:
RadioAir.removeRadio(avrora.sim.radio.Radio)

transmit

public void transmit(Radio r,
                     Radio.Transmission f)
transmit packet

Specified by:
transmit in interface RadioAir
Parameters:
r - the radio transmitting this packet
f - the radio packet transmitted into the air
See Also:
RadioAir.transmit(avrora.sim.radio.Radio, avrora.sim.radio.Radio.Transmission)

sampleRSSI

public int sampleRSSI(Radio r)
see simple air for more

Specified by:
sampleRSSI in interface RadioAir
Parameters:
r - the radio sampling the RSSI value
Returns:
an integer value representing the received signal strength indicator
See Also:
RadioAir.sampleRSSI(avrora.sim.radio.Radio)

readChannel

public byte readChannel(Radio r)
Description copied from interface: RadioAir
The readChannel() method reads the value of the channel at the current time so that the last 8 bits transmitted (where the bits are 0 if there are no transmissions) are returned.

Specified by:
readChannel in interface RadioAir
Parameters:
r - the radio sampling the channel
Returns:
the last 8 bits transmitted in the channel

getSynchronizer

public Synchronizer getSynchronizer()
Description copied from interface: RadioAir
The getSynchronizer() method gets the synchronizer for this air implementation.

Specified by:
getSynchronizer in interface RadioAir
Returns:
a reference to the synchronizer for this radio model.