interfaces
Class InterferenceLimitedInterface

java.lang.Object
  extended by core.NetworkInterface
      extended by interfaces.InterferenceLimitedInterface
All Implemented Interfaces:
ModuleCommunicationListener

public class InterferenceLimitedInterface
extends NetworkInterface

A simple Network Interface that provides a variable bit-rate service, where the bit-rate depends on the number of other transmitting stations within range The current transmit speed is updated only if there are ongoing transmissions. The configured transmit speed is the maximum obtainable speed.


Field Summary
 
Fields inherited from class core.NetworkInterface
connections, host, interfacetype, optimizer, RANGE_ID, SCAN_INTERVAL_ID, SCAN_INTERVAL_S, SPEED_ID, TRANSMIT_RANGE_S, TRANSMIT_SPEED_S, transmitRange, transmitSpeed
 
Constructor Summary
InterferenceLimitedInterface(InterferenceLimitedInterface ni)
          Copy constructor
InterferenceLimitedInterface(Settings s)
           
 
Method Summary
 void connect(NetworkInterface anotherInterface)
          Tries to connect this host to another host.
 void createConnection(NetworkInterface anotherInterface)
          Creates a connection to another host.
 int getTransmitSpeed()
          Returns the transmit speed of this network layer
 boolean isTransferring()
          Returns true if this interface is actually transmitting data
 NetworkInterface replicate()
          Replication function
 java.lang.String toString()
          Returns a string representation of the object.
 void update()
          Updates the state of current connections (i.e., tears down connections that are out of range).
 
Methods inherited from class core.NetworkInterface
connect, destroyConnection, disconnect, ensurePositiveValue, getAddress, getConnections, getHost, getInterfaceType, getLocation, getTransmitRange, isConnected, isScanning, isWithinRange, moduleValueChanged, reset, setClisteners, setHost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterferenceLimitedInterface

public InterferenceLimitedInterface(Settings s)

InterferenceLimitedInterface

public InterferenceLimitedInterface(InterferenceLimitedInterface ni)
Copy constructor

Parameters:
ni - the copied network interface object
Method Detail

replicate

public NetworkInterface replicate()
Description copied from class: NetworkInterface
Replication function

Specified by:
replicate in class NetworkInterface

getTransmitSpeed

public int getTransmitSpeed()
Returns the transmit speed of this network layer

Overrides:
getTransmitSpeed in class NetworkInterface
Returns:
the transmit speed

connect

public void connect(NetworkInterface anotherInterface)
Tries to connect this host to another host. The other host must be active and within range of this host for the connection to succeed.

Specified by:
connect in class NetworkInterface
Parameters:
anotherInterface - The host to connect to

update

public void update()
Updates the state of current connections (i.e., tears down connections that are out of range).

Specified by:
update in class NetworkInterface

createConnection

public void createConnection(NetworkInterface anotherInterface)
Creates a connection to another host. This method does not do any checks on whether the other node is in range or active

Specified by:
createConnection in class NetworkInterface
Parameters:
anotherInterface - The interface to create the connection to

isTransferring

public boolean isTransferring()
Returns true if this interface is actually transmitting data


toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class NetworkInterface
Returns:
a string representation of the object.