From afed274c10a93957f82a009824cafe8d83aa68a8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 15 Aug 2008 04:09:42 +0000 Subject: new branches --- VS-Sim-Javadoc/core/VSInternalProcess.html | 1014 ++++++++++++++++++++++++++++ 1 file changed, 1014 insertions(+) create mode 100644 VS-Sim-Javadoc/core/VSInternalProcess.html (limited to 'VS-Sim-Javadoc/core/VSInternalProcess.html') diff --git a/VS-Sim-Javadoc/core/VSInternalProcess.html b/VS-Sim-Javadoc/core/VSInternalProcess.html new file mode 100644 index 0000000..bf2ae40 --- /dev/null +++ b/VS-Sim-Javadoc/core/VSInternalProcess.html @@ -0,0 +1,1014 @@ + + + + + + +VSInternalProcess + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +core +
+Class VSInternalProcess

+
+java.lang.Object
+  extended by prefs.VSPrefs
+      extended by prefs.VSSerializablePrefs
+          extended by core.VSAbstractProcess
+              extended by core.VSInternalProcess
+
+
+
All Implemented Interfaces:
VSSerializable
+
+
+
+
public class VSInternalProcess
extends VSAbstractProcess
+ + +

+The class VSInternalProcess, an object of this class represents a process + of a simulator. +

+ +

+

+
Author:
+
Paul C. Buetow
+
+
+ +

+ + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class core.VSAbstractProcess
clockOffset, clockVariance, crashedColor, crashHistory, currentColor, DEFAULT_COLOR_VALUE_KEYS, DEFAULT_FLOAT_VALUE_KEYS, DEFAULT_INTEGER_VALUE_KEYS, DEFAULT_LONG_VALUE_KEYS, DEFAULT_STRING_VALUE_KEYS, globalTime, hasCrashed, hasStarted, isCrashed, isHighlighted, isPaused, lamportTime, lamportTimeHistory, localTime, loging, prefs, processID, processNum, protocolsToReset, random, randomCrashTask, serialVersionUID, simulatorVisualization, tasks, timeModified, tmpColor, vectorTime, vectorTimeHistory
+ + + + + + + +
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
+ voidaddClockOffset(long add) + +
+          Adds the clock offset.
+ voidaddedAProcess() + +
+          Added a process.
+protected  voidcreateRandomCrashTask_() + +
+           
+ voidcreateRandomCrashTask() + +
+          Creates the random crash task.
+ voidfinish() + +
+          The process' state is 'Finish'.
+ longgetARandomMessageOutageTime(long durationTime, + VSInternalProcess receiverProcess) + +
+          Gets the a random message outage time.
+ java.awt.ColorgetColor() + +
+          Gets the current process' color.
+ java.awt.ColorgetCrashedColor() + +
+          Gets the color of this process if it's crashed.
+ VSTaskgetCrashTask() + +
+          Gets the random crash task.
+ longgetDurationTime() + +
+           
+protected  VSAbstractProtocolgetProtocolObject_(java.lang.String protocolClassname) + +
+           
+ VSAbstractProtocolgetProtocolObject(java.lang.String protocolClassname) + +
+          Gets the protocol object.
+ intgetRandomPercentage() + +
+          Creates a random percentage 0..100 using the process' own pseudo + random number generator object of the VSRandom class.
+ VSSimulatorVisualizationgetSimulatorCanvas() + +
+          Gets the simulator canvas.
+ VSPriorityQueue<VSTask>getTasks() + +
+          Gets the tasks of the process.
+ voidhighlightOff() + +
+          Unhighlights the process.
+ voidhighlightOn() + +
+          Highlights the process.
+ booleanisPaused() + +
+          Checks if the process is paused.
+ voidpause() + +
+          The process' state is 'pause'.
+ voidplay() + +
+          The process' state is 'play'.
+ voidremovedAProcessAtIndex(int index) + +
+          Removes the process at the specified index.
+ voidreset() + +
+          Resets the process.
+ voidsendMessage(VSMessage message) + +
+          Called by a task if the process sends a message.
+ voidsetGlobalTime(long globalTime) + +
+          Sets the global time.
+ voidsetLocalTime(long localTime) + +
+          Sets the local time.
+ voidsetTasks(VSPriorityQueue<VSTask> tasks) + +
+          Sets the tasks of the process.
+ voidsyncTime(long globalTime) + +
+          Syncs the process' time.
+ booleantimeModified() + +
+          Checks if the time has been modified.
+ voidtimeModified(boolean timeModified) + +
+          Sets if the time has been modified by a task.
+protected  voidupdateFromPrefs_() + +
+           
+ voidupdateFromPrefs() + +
+          Called from the VSProcessEditor, after finishing editing! This makes + sure that the VSInternalProcess object is using the up to date prefs!
+ voidupdatePrefs() + +
+          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 core.VSAbstractProcess
deserialize, equals, fillWithDefaults, getARandomCrashTime, getClockVariance, getCrashHistoryArray, getGlobalTime, getLamportTime, getLamportTimeArray, getPrefs, getProcessID, getProcessNum, getTime, getVectorTime, getVectorTimeArray, hasCrashed, increaseLamportTime, increaseVectorAndLamportTimeIfAll, increaseVectorTime, init, initTimeFormats, isCrashed, isCrashed, log, resetTimeFormats, serialize, setClockVariance, setCurrentColor, setLamportTime, setProcessID, setTime, toString, toStringFull, updateLamportTime, updateVectorTime
+ + + + + + + +
Methods inherited from class prefs.VSPrefs
clear, copyBooleans, copyColors, copyFloats, copyIntegers, copyLongs, copyStrings, deserialize_, getAllFullKeys, getBoolean, getBooleanKeySet, getBooleanObj, getColor, getColorKeySet, getDescription, getFloat, getFloatKeySet, getFloatObj, getID, getInteger, getIntegerKeySet, getIntegerObj, getLong, getLongKeySet, getLongObj, getObject, getRestriction, getString, getStringKeySet, getUnit, getVector, getVectorKeySet, initBoolean, initBoolean, initBoolean, initColor, initColor, initDescription, initFloat, initFloat, initFloat, initFloat, initInteger, initInteger, initInteger, initInteger, initInteger, initInteger, initLong, initLong, initLong, initLong, initRestriction, initString, initString, initUnit, initVector, initVector, initVector, isEmpty, objectExists, removeObject, serialize_, setBoolean, setBoolean, setColor, setFloat, setFloat, setInteger, setInteger, setLong, setLong, setObject, setString, setVector
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+VSInternalProcess

+
+public VSInternalProcess(VSPrefs prefs,
+                         int processNum,
+                         VSSimulatorVisualization simulatorVisualization,
+                         VSLogging loging)
+
+
Instantiates a new process. +

+

+
Parameters:
prefs - the simulator's default prefs
processNum - the process num
simulatorVisualization - the simulator canvas
loging - the loging object
+
+ + + + + + + + +
+Method Detail
+ +

+updateFromPrefs

+
+public void updateFromPrefs()
+
+
Called from the VSProcessEditor, after finishing editing! This makes + sure that the VSInternalProcess object is using the up to date prefs! +

+

+
+
+
+
+ +

+updatePrefs

+
+public void updatePrefs()
+
+
Called from the VSProcessEditor, before starting editing! This makes + sure that the editor edits the up to date prefs of the process! +

+

+
+
+
+
+ +

+syncTime

+
+public void syncTime(long globalTime)
+
+
Syncs the process' time. This method is using the clockOffset and + clockVariance variables. This method is called repeatedly from the + VSSimulatorVisualization in order to update the process' local and global + time values. +

+

+
Parameters:
globalTime - the global time.
+
+
+
+ +

+highlightOn

+
+public void highlightOn()
+
+
Highlights the process. +

+

+
+
+
+
+ +

+highlightOff

+
+public void highlightOff()
+
+
Unhighlights the process. +

+

+
+
+
+
+ +

+reset

+
+public void reset()
+
+
Resets the process. +

+

+
+
+
+
+ +

+createRandomCrashTask

+
+public void createRandomCrashTask()
+
+
Creates the random crash task. The crash task will be created only if + the process is not crashed atm. and if + VSInternalProcess.getARandomCrashTime() * returns a non-negative value. + The random crash task uses the simulaion's global time for its + scheduling. +

+

+
+
+
+
+ +

+getRandomPercentage

+
+public int getRandomPercentage()
+
+
Creates a random percentage 0..100 using the process' own pseudo + random number generator object of the VSRandom class. +

+

+
Overrides:
getRandomPercentage in class VSAbstractProcess
+
+
+ +
Returns:
A random percentage 0..100.
+
+
+
+ +

+addClockOffset

+
+public void addClockOffset(long add)
+
+
Adds the clock offset. This method is used by the task manager. The + clock offset identifies if the local time of the process has changed and + how much.. +

+

+
Overrides:
addClockOffset in class VSAbstractProcess
+
+
+
Parameters:
add - the clock offset to add.
+
+
+
+ +

+play

+
+public void play()
+
+
The process' state is 'play'. Called by the simulator canvas. +

+

+
+
+
+
+ +

+pause

+
+public void pause()
+
+
The process' state is 'pause'. Called by the simulator canvas. +

+

+
+
+
+
+ +

+finish

+
+public void finish()
+
+
The process' state is 'Finish'. Called by the simulator canvas. +

+

+
+
+
+
+ +

+getColor

+
+public java.awt.Color getColor()
+
+
Gets the current process' color. +

+

+ +
Returns:
the current color of the process.
+
+
+
+ +

+getCrashedColor

+
+public java.awt.Color getCrashedColor()
+
+
Gets the color of this process if it's crashed. +

+

+ +
Returns:
the crashed color
+
+
+
+ +

+timeModified

+
+public boolean timeModified()
+
+
Checks if the time has been modified. by a task. + This mehod is needed by the task manager in order to add a clock offset + to the process object. +

+

+ +
Returns:
true, if yes
+
+
+
+ +

+timeModified

+
+public void timeModified(boolean timeModified)
+
+
Sets if the time has been modified by a task. +

+

+
Parameters:
timeModified - true, if it has been modified.
+
+
+
+ +

+setGlobalTime

+
+public void setGlobalTime(long globalTime)
+
+
Sets the global time. +

+

+
Parameters:
globalTime - the new global time
+
+
+
+ +

+getDurationTime

+
+public long getDurationTime()
+
+
+
+
+
+
+ +

+getARandomMessageOutageTime

+
+public long getARandomMessageOutageTime(long durationTime,
+                                        VSInternalProcess receiverProcess)
+
+
Gets the a random message outage time. +

+

+
Parameters:
durationTime - the duration time +
Returns:
the a random message outage time. It will be -1 if the message + will not get lost at all.
+
+
+
+ +

+getCrashTask

+
+public VSTask getCrashTask()
+
+
Gets the random crash task. +

+

+ +
Returns:
the random crash task
+
+
+
+ +

+isPaused

+
+public boolean isPaused()
+
+
Checks if the process is paused. +

+

+ +
Returns:
true, if is paused
+
+
+
+ +

+sendMessage

+
+public void sendMessage(VSMessage message)
+
+
Called by a task if the process sends a message. +

+

+
Parameters:
message - the message to send.
+
+
+
+ +

+getSimulatorCanvas

+
+public VSSimulatorVisualization getSimulatorCanvas()
+
+
Gets the simulator canvas. +

+

+ +
Returns:
the simulator canvas
+
+
+
+ +

+removedAProcessAtIndex

+
+public void removedAProcessAtIndex(int index)
+
+
Removes the process at the specified index. Called by the simulator + canvas if a process has been removed from the simulator. Needed in + order to update the vector time and the local processNum. +

+

+
Parameters:
index - the index the process has to get removed.
+
+
+
+ +

+addedAProcess

+
+public void addedAProcess()
+
+
Added a process. Needed in order to update the vector time's size. + Called by the simulator canvas if a process has been added to the + simulator. +

+

+
+
+
+
+ +

+getTasks

+
+public VSPriorityQueue<VSTask> getTasks()
+
+
Gets the tasks of the process. +

+

+ +
Returns:
The tasks
+
+
+
+ +

+setTasks

+
+public void setTasks(VSPriorityQueue<VSTask> tasks)
+
+
Sets the tasks of the process. +

+

+
Parameters:
tasks - The tasks
+
+
+
+ +

+getProtocolObject

+
+public VSAbstractProtocol getProtocolObject(java.lang.String protocolClassname)
+
+
Gets the protocol object. +

+

+
Parameters:
protocolClassname - the protocol classname +
Returns:
the protocol object
+
+
+
+ +

+setLocalTime

+
+public void setLocalTime(long localTime)
+
+
Sets the local time. +

+

+
Parameters:
localTime - the new local time.
+
+
+
+ +

+updateFromPrefs_

+
+protected void updateFromPrefs_()
+
+
+
Specified by:
updateFromPrefs_ in class VSAbstractProcess
+
+
+
+
+
+
+ +

+createRandomCrashTask_

+
+protected void createRandomCrashTask_()
+
+
+
Specified by:
createRandomCrashTask_ in class VSAbstractProcess
+
+
+
+
+
+
+ +

+getProtocolObject_

+
+protected VSAbstractProtocol getProtocolObject_(java.lang.String protocolClassname)
+
+
+
Specified by:
getProtocolObject_ in class VSAbstractProcess
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + -- cgit v1.2.3