|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Thread
psimjava.Pobject
psimjava.Sched
psimjava.Process
public abstract class Process
Basic behavior of a process in PsimJ.
The user's Java classes for processes must inherit this class.
PsimJ, a java package for OO discrete-event simulation. (C) Jose M. Garrido, June 2000, August 2003, Oct 2004, 2007
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
Process(java.lang.String pname)
Constructor for processes. |
| Method Summary | |
|---|---|
void |
clear_int_lev(int intlev)
Clears the Psim interrupt level of the process (to zero). |
void |
clear_int()
Clears the Psim interrupt levels of the process (to zero). |
boolean |
comm_wait()
Gets the value of the communication flag of the calling process. |
void |
deactivate(Process p)
Deactivates (i.e.) suspends the called process. |
void |
delay(double d)
Schedules the calling process at 'd' time units from the current clock time In the mean time, the process remains active in the event list waiting for the time to become the currently running process. |
java.lang.String |
get_name()
Gets the name of the calling process (activate object). |
double |
get_remain_t()
Get the remaining interval left after the process has been interrupted. |
boolean |
idle()
Checks if the process is idle (i.e., has been suspended). |
int |
int_level()
Gets the lowest interrupt level greater than zero of the process. |
int |
int_level(int intlev)
Gets the interrupt level specified of the process. |
boolean |
is_terminated()
Checks if the calling process has been terminated. |
protected abstract void |
Main_body()
This method represents the main code of every user process. |
void |
p_interrupt(int int_level)
Interrupts the calling process using the specified interrupt level. |
void |
reactivate(Process p)
Reactivates the called process. |
void |
run()
This method sets up and starts executing the main body of the process. |
void |
schedat(double timeat)
Schedules the called process at time 'timeat'. |
void |
set_comm_flag(boolean flag)
Sets the communication flag to the specified truth value |
void |
start()
This method overides the start method in the Java Thread class It inserts the Process into the out queue and then starts the thread running It must be called to have the Process actually start running |
void |
terminate()
Terminates the called process (object). |
| Methods inherited from class psimjava.Sched |
|---|
get_clock, rdstate, rdtime, set_state |
| Methods inherited from class psimjava.Pobject |
|---|
get_prio, set_prio |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Process(java.lang.String pname)
pname - String, the name to assigned to the process.| Method Detail |
|---|
public void start()
start in class java.lang.Threadpublic java.lang.String get_name()
public void terminate()
public boolean is_terminated()
public void deactivate(Process p)
p - Process, the process to suspend.public void reactivate(Process p)
p - Process, the process to reactivate.public void delay(double d)
d - double, the interval from the current simulation time after which the
current process will become the rurring process.public void p_interrupt(int int_level)
int_level - int, the interrupt level used with the interrupt.public double get_remain_t()
public void schedat(double timeat)
timeat - double, the instant at which the calling process will be scheduled.public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected abstract void Main_body()
public void clear_int()
public void clear_int_lev(int intlev)
public int int_level()
public int int_level(int intlev)
public boolean idle()
public boolean comm_wait()
public void set_comm_flag(boolean flag)
flag - boolean, the boolean value to set the communication flag
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||