Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.pastry.direct
Class BasicNetworkSimulator

    java.lang.Object
      rice.pastry.direct.BasicNetworkSimulator

All Implemented Interfaces:
  NetworkSimulator

Direct Known Subclasses:
  EuclideanNetwork, GenericNetwork, SphereNetwork

    public abstract class BasicNetworkSimulator

extends java.lang.Object
implements NetworkSimulator

DESCRIBE THE CLASS

Version:
  $Id: pretty.settings 2305 2005-03-11 20:22:33Z jeffh $
Author:
  jeffh

Field Summary
`protected Logger` | `logger` DESCRIBE THE FIELD
`protected SelectorManager` | `manager` DESCRIBE THE FIELD
`protected int` | `maxDiameter` DESCRIBE THE FIELD
`protected int` | `MIN_DELAY` DESCRIBE THE FIELD
`protected int` | `minDelay` DESCRIBE THE FIELD
`protected RandomSource` | `random` DESCRIBE THE FIELD

Constructor Summary
`BasicNetworkSimulator(Environment env)` Constructor for BasicNetworkSimulator.

Method Summary
`ScheduledMessage` | `deliverMessage(Message msg, DirectPastryNode node)` node should always be a local node, because this will be delivered instantly
`ScheduledMessage` | `deliverMessage(Message msg, DirectPastryNode node, int delay)` DESCRIBE THE METHOD
`ScheduledMessage` | `deliverMessage(Message msg, DirectPastryNode node, int delay, int period)` DESCRIBE THE METHOD
`ScheduledMessage` | `deliverMessageFixedRate(Message msg, DirectPastryNode node, int delay, int period)` DESCRIBE THE METHOD
`void` | `destroy(DirectPastryNode node)` set the liveliness of a NodeId
`CancellableTask` | `enqueueDelivery(Delivery d, int delay)` DESCRIBE THE METHOD
`DirectNodeHandle` | `getClosest(DirectNodeHandle nh)` find the closest NodeId to an input NodeId out of all NodeIds in the network
`Environment` | `getEnvironment()` Gets the Environment attribute of the BasicNetworkSimulator object
`TestRecord` | `getTestRecord()` get TestRecord
`boolean` | `isAlive(DirectNodeHandle nh)` testing if a NodeId is alive
`float` | `networkDelay(DirectNodeHandle a, DirectNodeHandle b)` computes the proximity between two NodeIds
`float` | `proximity(DirectNodeHandle a, DirectNodeHandle b)` DESCRIBE THE METHOD
`void` | `registerNode(DirectPastryNode dpn)` DESCRIBE THE METHOD
`void` | `removeNode(DirectPastryNode node)` DESCRIBE THE METHOD
`void` | `setFullSpeed()` Sets the FullSpeed attribute of the BasicNetworkSimulator object
`void` | `setMaxSpeed(float speed)` Sets the MaxSpeed attribute of the BasicNetworkSimulator object
`void` | `setTestRecord(TestRecord tr)` set TestRecord
`void` | `start()` DESCRIBE THE METHOD
`void` | `stop()` DESCRIBE THE METHOD

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface rice.pastry.direct.NetworkSimulator
`generateNodeRecord`

Field Detail

### logger

    protected Logger logger

  DESCRIBE THE FIELD

### random

    protected RandomSource random

  DESCRIBE THE FIELD

### MIN_DELAY

    protected int MIN_DELAY

  DESCRIBE THE FIELD

### manager

    protected SelectorManager manager

  DESCRIBE THE FIELD

### maxDiameter

    protected final int maxDiameter

  DESCRIBE THE FIELD

### minDelay

    protected final int minDelay

  DESCRIBE THE FIELD

Constructor Detail

### BasicNetworkSimulator

    public BasicNetworkSimulator(Environment env)

  Constructor for BasicNetworkSimulator.

  Parameters:
    `env` - DESCRIBE THE PARAMETER

Method Detail

### getTestRecord

    public TestRecord getTestRecord()

  get TestRecord

  Specified by:
    `getTestRecord` in interface `NetworkSimulator`
  Returns:
    the returned TestRecord

### isAlive

    public boolean isAlive(DirectNodeHandle nh)

  testing if a NodeId is alive

  Specified by:
    `isAlive` in interface `NetworkSimulator`
  Parameters:
    `nh` - DESCRIBE THE PARAMETER
  Returns:
    true if nid is alive false otherwise

### getClosest

    public DirectNodeHandle getClosest(DirectNodeHandle nh)

  find the closest NodeId to an input NodeId out of all NodeIds in the network

  Specified by:
    `getClosest` in interface `NetworkSimulator`
  Parameters:
    `nh` - DESCRIBE THE PARAMETER
  Returns:
    the NodeId closest to the input NodeId in the network

### getEnvironment

    public Environment getEnvironment()

  Gets the Environment attribute of the BasicNetworkSimulator object

  Specified by:
    `getEnvironment` in interface `NetworkSimulator`
  Returns:
    The Environment value

### setTestRecord

    public void setTestRecord(TestRecord tr)

  set TestRecord

  Specified by:
    `setTestRecord` in interface `NetworkSimulator`
  Parameters:
    `tr` - input TestRecord

### setMaxSpeed

    public void setMaxSpeed(float speed)

  Sets the MaxSpeed attribute of the BasicNetworkSimulator object

  Specified by:
    `setMaxSpeed` in interface `NetworkSimulator`
  Parameters:
    `speed` - The new MaxSpeed value

### setFullSpeed

    public void setFullSpeed()

  Sets the FullSpeed attribute of the BasicNetworkSimulator object

  Specified by:
    `setFullSpeed` in interface `NetworkSimulator`

### start

    public void start()

  DESCRIBE THE METHOD

  Specified by:
    `start` in interface `NetworkSimulator`

### stop

    public void stop()

  DESCRIBE THE METHOD

  Specified by:
    `stop` in interface `NetworkSimulator`

### enqueueDelivery

    public CancellableTask enqueueDelivery(Delivery d,
                                           int delay)

  DESCRIBE THE METHOD

  Specified by:
    `enqueueDelivery` in interface `NetworkSimulator`
  Parameters:
    `d` - DESCRIBE THE PARAMETER
    `delay` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessage

    public ScheduledMessage deliverMessage(Message msg,
                                           DirectPastryNode node)

  node should always be a local node, because this will be delivered instantly

  Specified by:
    `deliverMessage` in interface `NetworkSimulator`
  Parameters:
    `msg` - DESCRIBE THE PARAMETER
    `node` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessage

    public ScheduledMessage deliverMessage(Message msg,
                                           DirectPastryNode node,
                                           int delay)

  DESCRIBE THE METHOD

  Specified by:
    `deliverMessage` in interface `NetworkSimulator`
  Parameters:
    `msg` - DESCRIBE THE PARAMETER
    `node` - DESCRIBE THE PARAMETER
    `delay` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessage

    public ScheduledMessage deliverMessage(Message msg,
                                           DirectPastryNode node,
                                           int delay,
                                           int period)

  DESCRIBE THE METHOD

  Specified by:
    `deliverMessage` in interface `NetworkSimulator`
  Parameters:
    `msg` - DESCRIBE THE PARAMETER
    `node` - DESCRIBE THE PARAMETER
    `delay` - DESCRIBE THE PARAMETER
    `period` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessageFixedRate

    public ScheduledMessage deliverMessageFixedRate(Message msg,
                                                    DirectPastryNode node,
                                                    int delay,
                                                    int period)

  DESCRIBE THE METHOD

  Specified by:
    `deliverMessageFixedRate` in interface `NetworkSimulator`
  Parameters:
    `msg` - DESCRIBE THE PARAMETER
    `node` - DESCRIBE THE PARAMETER
    `delay` - DESCRIBE THE PARAMETER
    `period` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### destroy

    public void destroy(DirectPastryNode node)

  set the liveliness of a NodeId

  Specified by:
    `destroy` in interface `NetworkSimulator`
  Parameters:
    `node` - DESCRIBE THE PARAMETER

### networkDelay

    public float networkDelay(DirectNodeHandle a,
                              DirectNodeHandle b)

  computes the proximity between two NodeIds

  Specified by:
    `networkDelay` in interface `NetworkSimulator`
  Parameters:
    `a` - the first NodeId
    `b` - the second NodeId
  Returns:
    the proximity between the two input NodeIds

### proximity

    public float proximity(DirectNodeHandle a,
                           DirectNodeHandle b)

  DESCRIBE THE METHOD

  Specified by:
    `proximity` in interface `NetworkSimulator`
  Parameters:
    `a` - DESCRIBE THE PARAMETER
    `b` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### registerNode

    public void registerNode(DirectPastryNode dpn)

  DESCRIBE THE METHOD

  Specified by:
    `registerNode` in interface `NetworkSimulator`
  Parameters:
    `dpn` - DESCRIBE THE PARAMETER

### removeNode

    public void removeNode(DirectPastryNode node)

  DESCRIBE THE METHOD

  Specified by:
    `removeNode` in interface `NetworkSimulator`
  Parameters:
    `node` - DESCRIBE THE PARAMETER

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.