|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectprefs.VSPrefs
prefs.VSSerializablePrefs
core.VSAbstractProcess
core.VSInternalProcess
public class VSInternalProcess
The class VSInternalProcess, an object of this class represents a process of a simulator.
| Field Summary |
|---|
| Fields inherited from class prefs.VSPrefs |
|---|
BOOLEAN_PREFIX, COLOR_PREFIX, FLOAT_PREFIX, id, INTEGER_PREFIX, LONG_PREFIX, STRING_PREFIX, VECTOR_PREFIX |
| Constructor Summary | |
|---|---|
VSInternalProcess(VSPrefs prefs,
int processNum,
VSSimulatorVisualization simulatorVisualization,
VSLogging loging)
Instantiates a new process. |
|
| Method Summary | |
|---|---|
void |
addClockOffset(long add)
Adds the clock offset. |
void |
addedAProcess()
Added a process. |
protected void |
createRandomCrashTask_()
|
void |
createRandomCrashTask()
Creates the random crash task. |
void |
finish()
The process' state is 'Finish'. |
long |
getARandomMessageOutageTime(long durationTime,
VSInternalProcess receiverProcess)
Gets the a random message outage time. |
java.awt.Color |
getColor()
Gets the current process' color. |
java.awt.Color |
getCrashedColor()
Gets the color of this process if it's crashed. |
VSTask |
getCrashTask()
Gets the random crash task. |
long |
getDurationTime()
|
protected VSAbstractProtocol |
getProtocolObject_(java.lang.String protocolClassname)
|
VSAbstractProtocol |
getProtocolObject(java.lang.String protocolClassname)
Gets the protocol object. |
int |
getRandomPercentage()
Creates a random percentage 0..100 using the process' own pseudo random number generator object of the VSRandom class. |
VSSimulatorVisualization |
getSimulatorCanvas()
Gets the simulator canvas. |
VSPriorityQueue<VSTask> |
getTasks()
Gets the tasks of the process. |
void |
highlightOff()
Unhighlights the process. |
void |
highlightOn()
Highlights the process. |
boolean |
isPaused()
Checks if the process is paused. |
void |
pause()
The process' state is 'pause'. |
void |
play()
The process' state is 'play'. |
void |
removedAProcessAtIndex(int index)
Removes the process at the specified index. |
void |
reset()
Resets the process. |
void |
sendMessage(VSMessage message)
Called by a task if the process sends a message. |
void |
setGlobalTime(long globalTime)
Sets the global time. |
void |
setLocalTime(long localTime)
Sets the local time. |
void |
setTasks(VSPriorityQueue<VSTask> tasks)
Sets the tasks of the process. |
void |
syncTime(long globalTime)
Syncs the process' time. |
boolean |
timeModified()
Checks if the time has been modified. |
void |
timeModified(boolean timeModified)
Sets if the time has been modified by a task. |
protected void |
updateFromPrefs_()
|
void |
updateFromPrefs()
Called from the VSProcessEditor, after finishing editing! This makes sure that the VSInternalProcess object is using the up to date prefs! |
void |
updatePrefs()
Called from the VSProcessEditor, before starting editing! This makes sure that the editor edits the up to date prefs of the process! |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public VSInternalProcess(VSPrefs prefs,
int processNum,
VSSimulatorVisualization simulatorVisualization,
VSLogging loging)
prefs - the simulator's default prefsprocessNum - the process numsimulatorVisualization - the simulator canvasloging - the loging object| Method Detail |
|---|
public void updateFromPrefs()
public void updatePrefs()
public void syncTime(long globalTime)
globalTime - the global time.public void highlightOn()
public void highlightOff()
public void reset()
public void createRandomCrashTask()
public int getRandomPercentage()
getRandomPercentage in class VSAbstractProcesspublic void addClockOffset(long add)
addClockOffset in class VSAbstractProcessadd - the clock offset to add.public void play()
public void pause()
public void finish()
public java.awt.Color getColor()
public java.awt.Color getCrashedColor()
public boolean timeModified()
public void timeModified(boolean timeModified)
timeModified - true, if it has been modified.public void setGlobalTime(long globalTime)
globalTime - the new global timepublic long getDurationTime()
public long getARandomMessageOutageTime(long durationTime,
VSInternalProcess receiverProcess)
durationTime - the duration time
public VSTask getCrashTask()
public boolean isPaused()
public void sendMessage(VSMessage message)
message - the message to send.public VSSimulatorVisualization getSimulatorCanvas()
public void removedAProcessAtIndex(int index)
index - the index the process has to get removed.public void addedAProcess()
public VSPriorityQueue<VSTask> getTasks()
public void setTasks(VSPriorityQueue<VSTask> tasks)
tasks - The taskspublic VSAbstractProtocol getProtocolObject(java.lang.String protocolClassname)
protocolClassname - the protocol classname
public void setLocalTime(long localTime)
localTime - the new local time.protected void updateFromPrefs_()
updateFromPrefs_ in class VSAbstractProcessprotected void createRandomCrashTask_()
createRandomCrashTask_ in class VSAbstractProcessprotected VSAbstractProtocol getProtocolObject_(java.lang.String protocolClassname)
getProtocolObject_ in class VSAbstractProcess
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||