All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simula.simset.simulation.Process

java.lang.Object
   |
   +----simula.simset.Linkage
           |
           +----simula.simset.Link
                   |
                   +----simula.simset.simulation.Process

public abstract class Process
extends Link
implements Runnable
Accordingly to a process-oriented simulation, the Process objects implement the interacting sequential processes that model the behaviour of a system. A user-defines class can be turned into a process by extending this class. At any point in time, a process can be in one, and only one, of the following states:

Active -- The process is at the head of the event list and its actions are being executed. Only one process can be active at any one time.

Suspended -- The process is on the event list, scheduled to become active at a specified time in the future. The event list is ordered according to these 'event times'. The event time of a suspended process may be equal to that of the active process, in which case its actions will be executed before the clock is advanced.

Passive -- The process is not on the event list. Unless another process brings it back on to the list by means of an activation statement, its further actions will not be executed.

Terminated -- The process is not on the event list and has * no further actions to execute.

A process that is either active or suspended is said to be 'scheduled'. The Process object is currently implemented like a Java Thread.

See Also:
Link, Runnable

Variable Index

 o ACTIVE
Active status constant.
 o evTime
The time when the process will be acive.
 o PASSIVE
Passive status constant.
 o processThread
A reference to the Thread associated with this process.
 o sim
A reference to the simulation context.
 o status
The status of this process.
 o SUSPENDED
Suspended status constant.
 o TERMINATED
Terminated status constant.

Constructor Index

 o Process(Simulation)
Create a new process and insert it in the given simulation context.

Method Index

 o evtime()
If this process is scheduled, returns the time when will become active.
 o evtime(double)
Sets the time when the process will be active.
 o idle()
Returns True if the process is passive or terminated, False if it is scheduled.
 o nextev()
If the process is scheduled and is not the last process on the event list, this method returns a reference to the next process on the list (i.e.
 o processThread()
Returns the Thread associated with this process.
 o run()
This is the main body of the process.
 o setStatus(int)
Sets the new state of this process.
 o terminated()
Returns True if the process is terminated, False if it is scheduled or passive.

Variables

 o ACTIVE
 protected static final int ACTIVE
Active status constant.

 o SUSPENDED
 protected static final int SUSPENDED
Suspended status constant.

 o PASSIVE
 protected static final int PASSIVE
Passive status constant.

 o TERMINATED
 protected static final int TERMINATED
Terminated status constant.

 o status
 protected int status
The status of this process.

 o evTime
 protected double evTime
The time when the process will be acive.

 o processThread
 protected EventThread processThread
A reference to the Thread associated with this process.

 o sim
 protected Simulation sim
A reference to the simulation context.

Constructors

 o Process
 public Process(Simulation _simulation)
Create a new process and insert it in the given simulation context.

Methods

 o evtime
 public double evtime() throws SimulaException
If this process is scheduled, returns the time when will become active. An attempt to invoke this method from within a passive process results in an exception being thrown.

Throws: SimulaException
The process is either passive or terminated.
 o evtime
 protected void evtime(double _time)
Sets the time when the process will be active.

 o idle
 public boolean idle()
Returns True if the process is passive or terminated, False if it is scheduled.

Returns:
True if the process is passive or terminated, False if it is scheduled.
 o nextev
 public Process nextev()
If the process is scheduled and is not the last process on the event list, this method returns a reference to the next process on the list (i.e. the one that will become active after this); otherwise returns Null.

 o processThread
 protected EventThread processThread()
Returns the Thread associated with this process.

 o run
 public abstract void run()
This is the main body of the process.

 o setStatus
 protected void setStatus(int newStatus)
Sets the new state of this process.

 o terminated
 public boolean terminated()
Returns True if the process is terminated, False if it is scheduled or passive.

Returns:
True if the process is terminated, False if it is scheduled or passive.

All Packages  Class Hierarchy  This Package  Previous  Next  Index