|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcz.zcu.fav.kiv.cs.CSProcess
One of the most importatnt classes for the user, he should extend this class, if he wants to describe a process of the distributed simulation.
| Field Summary | |
protected CSSimulation |
parent
The simulation submodel that this process is a part of. |
| Constructor Summary | |
CSProcess(java.lang.String name,
CSSimulation parent,
int ID,
int[] neighbours,
double[] timeToNeighbour)
Creates the CSProcess and sends his description to the server. |
|
| Method Summary | |
protected void |
activate(double when,
int who)
Schedules the specified neighbour for the specified time with null message. |
protected void |
activate(double when,
int who,
java.lang.String message)
Schedules the specified neighbour for the specified time with the specified message. |
protected void |
cancel(int who,
java.lang.String message)
Cancel events of the specified process with the specified message. |
protected void |
cancelAll(int who)
Cancel all events of the specified process. |
protected void |
csLife()
The programmer should overwrite this method. |
protected void |
error(java.lang.String line)
Prints out a text error message, either to the error output or to the simulation window. |
protected int |
getAutoID()
Returns the local ID assigned by the submodel. |
protected int |
getFromWho()
Returns an ID of a neighbour, who has me scheduled for now. |
protected int |
getID()
Returns an ID specified by user. |
protected java.lang.String |
getMessage()
Returns the actual message for this process in the current part of his life. |
java.lang.String |
getName()
Returns the local ID assigned by the submodel. |
protected CSCalendarEvent |
getNextCE()
Returns the event of my next execution in this step of the distributed simulation. |
protected int |
getNextFromWho()
Returns the neighbour who has scheduled my next execution in this step of the distributed simulation. |
protected java.lang.String |
getNextMessage()
Returns the message for my next execution in this step of the distributed simulation. |
protected double |
getNextTime()
Returns the time of my next execution in this step of the distributed simulation. |
protected long |
getNumber()
Returns the ID assigned by J-Sim. |
protected void |
hold(double howLong)
Holds this process for the specified time with the null message. |
protected void |
hold(double howLong,
java.lang.String message)
Holds this process for the specified time with the specified message. |
protected void |
life()
It's here only to tell the user, that this method is not used in CSProcess. |
protected void |
message(java.lang.String line)
Prints out a text message, either to the standard output or to the simulation window. |
protected boolean |
somethingNext()
Returns True, if there is a message for me in this step of the distributed simulation. |
void |
startAt(double when,
java.lang.String message)
Schedules the first execution of this process. |
protected void |
waitForNextMessage()
Passivates the current process, he will be woken up with a new message for him. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected CSSimulation parent
| Constructor Detail |
public CSProcess(java.lang.String name,
CSSimulation parent,
int ID,
int[] neighbours,
double[] timeToNeighbour)
throws cz.zcu.fav.kiv.jsim.JSimSimulationAlreadyTerminatedException,
cz.zcu.fav.kiv.jsim.JSimInvalidParametersException,
cz.zcu.fav.kiv.jsim.JSimTooManyProcessesException
name - String Name of this process.parent - CSSimulation Parent submodel.ID - int ID of this process from the user.neighbours - int[] Array of neigbours.timeToNeighbour - double[] Distances to these neighbours.| Method Detail |
protected void csLife()
protected final void life()
protected final void waitForNextMessage()
throws cz.zcu.fav.kiv.jsim.JSimSecurityException
cz.zcu.fav.kiv.jsim.JSimSecurityException
protected final void hold(double howLong)
throws cz.zcu.fav.kiv.jsim.JSimSecurityException
howLong - double The time how long should I sleep.
cz.zcu.fav.kiv.jsim.JSimSecurityException
protected final void hold(double howLong,
java.lang.String message)
throws cz.zcu.fav.kiv.jsim.JSimSecurityException
howLong - double The time how long should I sleep.message - String The message I will have after sleep.
cz.zcu.fav.kiv.jsim.JSimSecurityException
public final void startAt(double when,
java.lang.String message)
throws cz.zcu.fav.kiv.jsim.JSimSecurityException,
cz.zcu.fav.kiv.jsim.JSimInvalidParametersException,
CSSecurityException
when - double Whenmessage - String With what message.
CSSecurityException - This process has already started.
cz.zcu.fav.kiv.jsim.JSimSecurityException
cz.zcu.fav.kiv.jsim.JSimInvalidParametersException
protected final void activate(double when,
int who)
throws CSSecurityException
CSSecurityException - Attempt to activate wrong neighbour and/or at wrong time.
protected final void activate(double when,
int who,
java.lang.String message)
throws CSSecurityException
when - double When should he be woken up.who - int Who is this message for.message - String What message will he have in scheduling part of life.
CSSecurityException - Attempt to activate a wrong neighbour and/or at a wrong time.protected final void cancelAll(int who)
who - int ID of requested process
protected final void cancel(int who,
java.lang.String message)
who - int ID of requested processmessage - String Requested messagesprotected void message(java.lang.String line)
protected void error(java.lang.String line)
protected final java.lang.String getMessage()
protected final int getFromWho()
protected final int getID()
protected final int getAutoID()
protected final long getNumber()
public final java.lang.String getName()
protected final boolean somethingNext()
protected final double getNextTime()
protected final java.lang.String getNextMessage()
protected final int getNextFromWho()
protected final CSCalendarEvent getNextCE()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||