fdda.core.demonstration
Interface Demonstrator

All Known Implementing Classes:
DemonstratorImpl

public interface Demonstrator

Manages the demonstration of the algorithm of a project. Also provides the link to the graphical visualization. The demonstration will run in an extra thread.

Author:
Jörg Rüdenauer

Method Summary
 void addActiveMessage(Message message)
          Adds a message to the active messages.
 void addActiveNode(Node node)
          Adds a node to the active nodes.
 Message createMessage(Node sender, Node receiver, Object payload)
          Creates a new message.
 Statistics getCurrentStatistics()
          Returns up-to-date statistics about the demo.
 boolean isPaused()
          Returns whether the demo is paused.
 boolean isRunning()
          Returns whether the demo is running (and not paused).
 boolean isStopped()
          Returns whether the demo is stopped.
 void pauseActiveNode(Node node, long timeInMillis)
          Removes a node from the active nodes for a certain time.
 void removeActiveNode(Node node)
          Removes a node from the active nodes.
 

Method Detail

isStopped

public boolean isStopped()
Returns whether the demo is stopped.

Returns:
whether the demo is stopped

isPaused

public boolean isPaused()
Returns whether the demo is paused.

Returns:
whether the demo is paused

isRunning

public boolean isRunning()
Returns whether the demo is running (and not paused).

Returns:
whether the demo is paused

addActiveNode

public void addActiveNode(Node node)
Adds a node to the active nodes. That means that the run()-method of this node will be called once each cycle.

Parameters:
node - the node

pauseActiveNode

public void pauseActiveNode(Node node,
                            long timeInMillis)
Removes a node from the active nodes for a certain time. After that time, the node becomes active again. The algorithm isn't terminated while there are still nodes waiting for activation at a fixed point of time.

Parameters:
node - the node
timeInMillis - time in milliseconds after which the node will be activated

removeActiveNode

public void removeActiveNode(Node node)
Removes a node from the active nodes. That means that its run()-method won't be called anymore.

Parameters:
node - the node

addActiveMessage

public void addActiveMessage(Message message)
Adds a message to the active messages. That means that this message is on its way to a receiving node. Once it reaches its destination, it is automatically removed.

Parameters:
message - the message

createMessage

public Message createMessage(Node sender,
                             Node receiver,
                             Object payload)
Creates a new message.

Parameters:
sender - the node that sends the message
receiver - the node that shall receive the message
payload - possible payload that the message carries
Returns:
the newly created message
Throws:
IllegalArgumentException - if the nodes are not neighboured

getCurrentStatistics

public Statistics getCurrentStatistics()
Returns up-to-date statistics about the demo. These statistics even continue to get updated.

Returns:
statistics for the demo


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.