nl.tudelft.ewi.alg.distsim.example
Class MyProc
java.lang.Object
nl.tudelft.ewi.alg.distsim.DProcess<ChainLetter>
nl.tudelft.ewi.alg.distsim.example.MyProc
public class MyProc
- extends DProcess<ChainLetter>
These distributed processes each start off with a message of their own.
This message is a "chain letter" of sorts and must be passed around randomly
a couple of times, until it eventually winds up again with the originator.
- Author:
- L@eacute;on Planken
Method Summary |
boolean |
isDone()
Whether or not this process is done. |
protected void |
receiveMessage(int senderID,
ChainLetter msg)
Subclasses need to implement this. |
void |
setProcs(int[] processIDs)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
MESSAGES
public static final java.lang.String[] MESSAGES
TWIDDLE_TIME
public static final int TWIDDLE_TIME
- See Also:
- Constant Field Values
MyProc
public MyProc(MasterProcess<ChainLetter> master,
int id,
int processcount)
isDone
public boolean isDone()
- Description copied from class:
DProcess
- Whether or not this process is done.
- Specified by:
isDone
in class DProcess<ChainLetter>
- Returns:
- false if there is work to do yet even if no message is available; if so, receiveMessage(null,null) is called.
receiveMessage
protected void receiveMessage(int senderID,
ChainLetter msg)
- Description copied from class:
DProcess
- Subclasses need to implement this.
- Specified by:
receiveMessage
in class DProcess<ChainLetter>
- Parameters:
senderID
- the sender of the messagemsg
- the message received.
setProcs
public void setProcs(int[] processIDs)