it.unitn.ds.peersim.observers
Class ConsensusObserver

java.lang.Object
  extended by peersim.vector.SingleValueObserver
      extended by it.unitn.ds.peersim.observers.ConsensusObserver
All Implemented Interfaces:
peersim.core.Control

public class ConsensusObserver
extends peersim.vector.SingleValueObserver

Distributed Systems Course Project

Year: 2009/2010

University of Trento

ConsensusObserver -. Implements controls about the execution of the protocol, creates the logs necessary to creates the graphs and checks when the execution is terminated.

Version:
1.0
Author:
Avancini Mattia, Giampaolo Farina
See Also:
http://peersim.sourceforge.net/

Constructor Summary
ConsensusObserver(java.lang.String prefix)
          This method is called when information about an Consensus which was previously requested using an asynchronous interface becomes available.
 
Method Summary
 void countDecided()
          This method is called when information about an Consensus which was previously requested using an asynchronous interface becomes available.
 boolean execute()
          Print statistics over a vector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsensusObserver

public ConsensusObserver(java.lang.String prefix)
This method is called when information about an Consensus which was previously requested using an asynchronous interface becomes available.

Parameters:
prefix - the prefix
Method Detail

execute

public boolean execute()
Print statistics over a vector. The vector is defined by a protocol, specified by , that has to implement

Specified by:
execute in interface peersim.core.Control
Overrides:
execute in class peersim.vector.SingleValueObserver
Returns:
true if the standard deviation is below the value of SingleValue. Statistics printed are: min, max, number of samples, average, variance, number of minimal instances, number of maximal instances (using IncrementalStats.toString()). , and the time of the simulation is larger then zero (i.e. it has started).

countDecided

public void countDecided()
                  throws java.io.IOException
This method is called when information about an Consensus which was previously requested using an asynchronous interface becomes available.

Throws:
java.io.IOException