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
Interface NetworkSimulator

All Known Implementing Classes:
  BasicNetworkSimulator, EuclideanNetwork, GenericNetwork, SphereNetwork

    public interface NetworkSimulator

Interface to an object which is simulating the network.

Version:
  $Id: NetworkSimulator.java 3449 2006-11-10 12:29:45Z jeffh $
Author:
  Andrew Ladd

Method Summary
`ScheduledMessage` | `deliverMessage(Message msg, DirectPastryNode node)` Deliver message ASAP.
`ScheduledMessage` | `deliverMessage(Message msg, DirectPastryNode node, int delay)` Deliver message.
`ScheduledMessage` | `deliverMessage(Message msg, DirectPastryNode node, int delay, int period)` Deliver message.
`ScheduledMessage` | `deliverMessageFixedRate(Message msg, DirectPastryNode node, int delay, int period)` Deliver message.
`void` | `destroy(DirectPastryNode dpn)` DESCRIBE THE METHOD
`CancellableTask` | `enqueueDelivery(Delivery del, int delay)` Deliver message.
`NodeRecord` | `generateNodeRecord()` Generates a random node record
`DirectNodeHandle` | `getClosest(DirectNodeHandle nh)` Returns the closest Node in proximity.
`Environment` | `getEnvironment()` Gets the Environment attribute of the NetworkSimulator object
`TestRecord` | `getTestRecord()` Gets the TestRecord attribute of the NetworkSimulator object
`boolean` | `isAlive(DirectNodeHandle nh)` Checks to see if a node id is alive.
`float` | `networkDelay(DirectNodeHandle a, DirectNodeHandle b)` Determines delivery time from a to b.
`float` | `proximity(DirectNodeHandle a, DirectNodeHandle b)` Determines rtt between two nodes.
`void` | `registerNode(DirectPastryNode dpn)` Registers a node handle with the simulator.
`void` | `removeNode(DirectPastryNode node)` DESCRIBE THE METHOD
`void` | `setFullSpeed()` unlimited maxSpeed
`void` | `setMaxSpeed(float rate)` The max rate of the simulator compared to realtime.
`void` | `setTestRecord(TestRecord tr)` Sets the TestRecord attribute of the NetworkSimulator object
`void` | `start()` DESCRIBE THE METHOD
`void` | `stop()` DESCRIBE THE METHOD

Method Detail

### getEnvironment

    Environment getEnvironment()

  Gets the Environment attribute of the NetworkSimulator object

  Returns:
    The Environment value

### registerNode

    void registerNode(DirectPastryNode dpn)

  Registers a node handle with the simulator.

  Parameters:
    `dpn` - DESCRIBE THE PARAMETER

### isAlive

    boolean isAlive(DirectNodeHandle nh)

  Checks to see if a node id is alive.

  Parameters:
    `nh` - DESCRIBE THE PARAMETER
  Returns:
    true if alive, false otherwise.

### proximity

    float proximity(DirectNodeHandle a,
                    DirectNodeHandle b)

  Determines rtt between two nodes.

  Parameters:
    `a` - a node id.
    `b` - another node id.
  Returns:
    proximity of b to a.

### networkDelay

    float networkDelay(DirectNodeHandle a,
                       DirectNodeHandle b)

  Determines delivery time from a to b.

  Parameters:
    `a` - a node id.
    `b` - another node id.
  Returns:
    proximity of b to a.

### deliverMessage

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

  Deliver message.

  Parameters:
    `msg` - message to deliver.
    `node` - the Pastry node to deliver it to.
    `delay` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessage

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

  Deliver message.

  Parameters:
    `msg` - message to deliver.
    `node` - the Pastry node to deliver it to.
    `delay` - DESCRIBE THE PARAMETER
    `period` - to deliver the message after the delay
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessageFixedRate

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

  Deliver message.

  Parameters:
    `msg` - message to deliver.
    `node` - the Pastry node to deliver it to.
    `delay` - DESCRIBE THE PARAMETER
    `period` - to deliver the message after the delay
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessage

    ScheduledMessage deliverMessage(Message msg,
                                    DirectPastryNode node)

  Deliver message ASAP.

  Parameters:
    `msg` - message to deliver.
    `node` - the Pastry node to deliver it to.
  Returns:
    DESCRIBE THE RETURN VALUE

### setTestRecord

    void setTestRecord(TestRecord tr)

  Sets the TestRecord attribute of the NetworkSimulator object

  Parameters:
    `tr` - The new TestRecord value

### getTestRecord

    TestRecord getTestRecord()

  Gets the TestRecord attribute of the NetworkSimulator object

  Returns:
    The TestRecord value

### getClosest

    DirectNodeHandle getClosest(DirectNodeHandle nh)

  Returns the closest Node in proximity.

  Parameters:
    `nh` - DESCRIBE THE PARAMETER
  Returns:

### destroy

    void destroy(DirectPastryNode dpn)

  DESCRIBE THE METHOD

  Parameters:
    `dpn` - DESCRIBE THE PARAMETER

### generateNodeRecord

    NodeRecord generateNodeRecord()

  Generates a random node record

  Returns:

### removeNode

    void removeNode(DirectPastryNode node)

  DESCRIBE THE METHOD

  Parameters:
    `node` - DESCRIBE THE PARAMETER

### start

    void start()

  DESCRIBE THE METHOD

### stop

    void stop()

  DESCRIBE THE METHOD

### enqueueDelivery

    CancellableTask enqueueDelivery(Delivery del,
                                    int delay)

  Deliver message.

  Parameters:
    `del` - DESCRIBE THE PARAMETER
    `delay` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### setMaxSpeed

    void setMaxSpeed(float rate)

  The max rate of the simulator compared to realtime. The rule is that the simulated clock will not be set to a value greater than the factor from system-time that the call was made. Thus if 1 hour ago, you said the simulator should run at 10x realtime the simulated clock will only have advanced 10 hours. Note that if the simulator cannot keep up with the system clock in the early part, it may move faster than the value you set to "catch up" To prevent this speed-up from becoming unbounded, you may wish to call setMaxSpeed() periodically or immeadiately after periods of expensive calculations. Setting the simulation speed to zero will not pause the simulation, you must call stop() to do that.

  Parameters:
    `rate` - The new MaxSpeed value

### setFullSpeed

    void setFullSpeed()

  unlimited maxSpeed

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.