example.edaggregation
Class AverageED
java.lang.Object
peersim.vector.SingleValueHolder
example.edaggregation.AverageED
- All Implemented Interfaces:
- java.lang.Cloneable, CDProtocol, Protocol, EDProtocol, SingleValue
public class AverageED
- extends SingleValueHolder
- implements CDProtocol, EDProtocol
Event driven version of epidemic averaging.
Constructor Summary |
AverageED(java.lang.String prefix)
|
Method Summary |
void |
nextCycle(Node node,
int pid)
This is the standard method the define periodic activity. |
void |
processEvent(Node node,
int pid,
java.lang.Object event)
This is the standard method to define to process incoming messages. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AverageED
public AverageED(java.lang.String prefix)
- Parameters:
prefix
- string prefix for config properties
nextCycle
public void nextCycle(Node node,
int pid)
- This is the standard method the define periodic activity.
The frequency of execution of this method is defined by a
CDScheduler
component in the configuration.
- Specified by:
nextCycle
in interface CDProtocol
- Parameters:
node
- the node on which this component is runpid
- the id of this protocol in the protocol array
processEvent
public void processEvent(Node node,
int pid,
java.lang.Object event)
- This is the standard method to define to process incoming messages.
- Specified by:
processEvent
in interface EDProtocol
- Parameters:
node
- the local nodepid
- the identifier of this protocolevent
- the delivered event