peersim.cdsim
Class FullNextCycle

java.lang.Object
  extended by peersim.cdsim.FullNextCycle
All Implemented Interfaces:
Control
Direct Known Subclasses:
NextCycle

public class FullNextCycle
extends java.lang.Object
implements Control

Control to run a cycle of the cycle driven simulation. This does not need to be explicitly configured (although you can do it for hacking purposes).


Parameter Summary
getpair
          The type of the getPair function.
shuffle
          Shuffle iteration order if set.
 
Field Summary
protected  boolean getpair_rand
           
protected  Scheduler[] protSchedules
          Holds the protocol schedulers of this simulation
protected  RandPermutation rperm
          The random permutation to use if config par "shuffle" is set.
protected  boolean shuffle
           
 
Constructor Summary
FullNextCycle(java.lang.String prefix)
          Reads config parameters and Schedulers.
 
Method Summary
 boolean execute()
          Execute all the CDProtocols on all nodes that are up.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Parameter Detail

getpair

The type of the getPair function. This parameter is of historic interest and was needed in a publication we wrote. You don't need to care about this. But if you wanna know: if set to "rand", then in a cycle the simulator does not simply iterate through the nodes, but instead picks a random one N times, where N is the network size.


shuffle

Shuffle iteration order if set. Not set by default. If set, then nodes are iterated in a random order. However, in the network the nodes actually stay in the order they originally were. The price for leaving the network untouched is memory: we need to store the permutation we use to iterate the network.

Field Detail

getpair_rand

protected final boolean getpair_rand

shuffle

protected final boolean shuffle

protSchedules

protected Scheduler[] protSchedules
Holds the protocol schedulers of this simulation


rperm

protected RandPermutation rperm
The random permutation to use if config par "shuffle" is set.

Constructor Detail

FullNextCycle

public FullNextCycle(java.lang.String prefix)
Reads config parameters and Schedulers.

Method Detail

execute

public boolean execute()
Execute all the CDProtocols on all nodes that are up. If the node goes down as a result of the execution of a protocol, then the rest of the protocols on that node are not executed and we move on to the next node. It sets the CDState appropriately.

Specified by:
execute in interface Control
Returns:
always false