example.edaggregation
Class AverageED
java.lang.Object
peersim.vector.SingleValueHolder
example.edaggregation.AverageED
- All Implemented Interfaces:
- java.lang.Cloneable, CDProtocol, Protocol, EDProtocol<example.edaggregation.AverageMessage>, SingleValue
public class AverageED
- extends SingleValueHolder
- implements CDProtocol, EDProtocol<example.edaggregation.AverageMessage>
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,
example.edaggregation.AverageMessage aem)
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,
example.edaggregation.AverageMessage aem)
- This is the standard method to define to process incoming messages.
- Specified by:
processEvent in interface EDProtocol<example.edaggregation.AverageMessage>
- Parameters:
node - the local nodepid - the identifier of this protocolaem - the delivered event