All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simulation.process.Process

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

public abstract class Process
extends simset.Link
This class may be used for process-based discrete event simulation.

Processes are created as instances of Process-derived classes that override the abstract method actions. The actions method is used to describe their life cycles.

Since Process is a subclass of Link, every process has the capability of being a member of a two-way list. This is useful, for example, when processes must wait in a queue.

See Also:
simset.Link, simset.Head

Variable Index

 o after
 o at
 o before
 o delay
 o prior

Constructor Index

 o Process()

Method Index

 o activate(Process)
Causes the specified passive process to become active at the current simulation time (after processes with the same event time).
 o activate(Process, Process.After, Process)
Schedules the first (passive) process immediately after the second (scheduled) one, and at the same event time.
 o activate(Process, Process.At, double)
Causes the specified passive process to become active at the specified event time (after processes with the same event time).
 o activate(Process, Process.At, double, Process.Prior)
Causes the specified passive process to become active at the specified event time (before processes with the same event time).
 o activate(Process, Process.Before, Process)
Schedules the first (passive) process immediately before the second (scheduled) one, and at the same event time.
 o activate(Process, Process.Delay, double)
Causes the specified passive process to become active after the specified delay (after processes with the same event time).
 o activate(Process, Process.Delay, double, Process.Prior)
Causes the specified passive process to become active after the specified delay (before processes with the same event time).
 o cancel(Process)
Cancels a scheduled event.
 o current()
Returns the currently active process.
 o evTime()
Returns the event time of this process.
 o hold(double)
Suspends the currently active process for a specified period of simulated time.
 o idle()
Tests if this process is scheduled.
 o main()
Returns the main process.
 o nextEv()
Returns the next process (if any) in the event list.
 o passivate()
Passivates the currently active process.
 o reactivate(Process)
Causes the specified process to become active at the current simulation time (after processes with the same event time).
 o reactivate(Process, Process.After, Process)
Schedules the first process immediately after the second one and at the same event time.
 o reactivate(Process, Process.At, double)
Causes the specified process to become active at the specified event time (after processes with the same event time).
 o reactivate(Process, Process.At, double, Process.Prior)
Causes the specified process to become active at the specified event time (before processes with the same event time).
 o reactivate(Process, Process.Before, Process)
Schedules the first process immediately before the second one and at the same event time.
 o reactivate(Process, Process.Delay, double)
Causes the specified process to become active after the specified delay (after processes with the same event time).
 o reactivate(Process, Process.Delay, double, Process.Prior)
Causes the specified process to become active after the specified delay (before processes with the same event time).
 o terminated()
Tests if this process is terminated.
 o time()
Returns the current simulation time.
 o wait(Head)
Causes the currently active process to wait in a queue.

Variables

 o at
 public static final simulation.process.Process.At at
 o delay
 public static final simulation.process.Process.Delay delay
 o before
 public static final simulation.process.Process.Before before
 o after
 public static final simulation.process.Process.After after
 o prior
 public static final simulation.process.Process.Prior prior

Constructors

 o Process
 public Process()

Methods

 o idle
 public final boolean idle()
Tests if this process is scheduled.

Returns:
true if this process is not currently in the event list; false otherwise.
 o terminated
 public final boolean terminated()
Tests if this process is terminated.

Returns:
true if this process has executed all its actions; false otherwise.
 o evTime
 public final double evTime()
Returns the event time of this process.

Throws: RuntimeException
if this process is idle.
 o nextEv
 public final simulation.process.Process nextEv()
Returns the next process (if any) in the event list.

 o current
 public static final simulation.process.Process current()
Returns the currently active process.

 o time
 public static final double time()
Returns the current simulation time.

 o main
 public static final simulation.process.Process main()
Returns the main process. The main process is the first process activated in a simulation.

 o hold
 public static final void hold(double t)
Suspends the currently active process for a specified period of simulated time.

The process is rescheduled for reactivation at time() + t.

Parameters:
t - The length of the period of suspension.
 o passivate
 public static final void passivate()
Passivates the currently active process.

current is removed from the event list, and the actions of the new current are resumed.

Throws: RuntimeException
if the event list becomes empty.
 o wait
 public static final void wait(simset.Head q)
Causes the currently active process to wait in a queue.

The currently active process is added to the two-way list passed as the parameter, and passivate is called.

Parameters:
q - The head of the list.
Throws: RuntimeException
if the event list becomes empty.
 o cancel
 public static final void cancel(simulation.process.Process p)
Cancels a scheduled event.

The process passed as the parameter is removed from the event list and the actions of the new current are resumed. If the process is currently active or suspended, it becomes passive. If it is passive, terminated or null, the call has no effect.

Parameters:
p - The process to be cancelled.
Throws: RuntimeException
if the event list becomes empty.
 o activate
 public static final void activate(simulation.process.Process p)
Causes the specified passive process to become active at the current simulation time (after processes with the same event time). The call has no effect unless the process is passive.

The process is inserted into the event list at a position corresponding to the current simulation time and after any processes with the same event time.

Parameters:
p - The process to be activated.
 o activate
 public static final void activate(simulation.process.Process p,
                                   simulation.process.Process.At at,
                                   double t)
Causes the specified passive process to become active at the specified event time (after processes with the same event time). The call has no effect unless the process is passive.

The process is inserted into the event list at a position corresponding to the current simulation time and after any processes with the same event time.

Parameters:
p - The process to be activated.
at - The reference at.
t - The event time.
 o activate
 public static final void activate(simulation.process.Process p,
                                   simulation.process.Process.At at,
                                   double t,
                                   simulation.process.Process.Prior prior)
Causes the specified passive process to become active at the specified event time (before processes with the same event time). The call has no effect unless the process is passive.

The process is inserted into the event list at a position corresponding to the current simulation time and before any processes with the same event time.

Parameters:
p - The process to be activated.
at - The reference at.
t - The event time.
prior - The constant prior.
 o activate
 public static final void activate(simulation.process.Process p,
                                   simulation.process.Process.Delay delay,
                                   double t)
Causes the specified passive process to become active after the specified delay (after processes with the same event time). The call has no effect unless the process is passive.

The process is inserted into the event list at a position corresponding to the current simulation time plus the the specified delay. The process is inserted after any processes with the same event time.

Parameters:
p - The process to be activated.
delay - The reference delay.
t - The delay.
 o activate
 public static final void activate(simulation.process.Process p,
                                   simulation.process.Process.Delay d,
                                   double t,
                                   simulation.process.Process.Prior prior)
Causes the specified passive process to become active after the specified delay (before processes with the same event time). The call has no effect unless the process is passive.

The process is inserted into the event list at a position corresponding to the current simulation time plus the the specified delay. The process is inserted before any processes with the same event time.

Parameters:
p - The process to be activated.
delay - The reference delay.
t - The event time.
prior - The reference prior.
 o activate
 public static final void activate(simulation.process.Process p1,
                                   simulation.process.Process.Before before,
                                   simulation.process.Process p2)
Schedules the first (passive) process immediately before the second (scheduled) one, and at the same event time. The call has no effect unless the first process is passive and the second one is scheduled.

The process p1 is inserted into the event list immediately before the process p2 and with the same event time.

Parameters:
p1 - The process to be activated.
before - The reference before.
p2 - The process before which p1 is to be scheduled.
 o activate
 public static final void activate(simulation.process.Process p1,
                                   simulation.process.Process.After after,
                                   simulation.process.Process p2)
Schedules the first (passive) process immediately after the second (scheduled) one, and at the same event time. The call has no effect unless the first process is passive and the second one is scheduled.

The process p1 is inserted into the event list immediately after the process p2 and with the same event time.

Parameters:
p1 - The process to be activated.
before - The constant after.
p2 - The process after which p1 is to be scheduled.
 o reactivate
 public static final void reactivate(simulation.process.Process p)
Causes the specified process to become active at the current simulation time (after processes with the same event time).

The process is positioned in the event list at a position corresponding to the current simulation time and after any processes with the same event time.

Parameters:
p - The process to be reactivated.
 o reactivate
 public static final void reactivate(simulation.process.Process p,
                                     simulation.process.Process.At at,
                                     double t)
Causes the specified process to become active at the specified event time (after processes with the same event time).

The process is positioned in the event list at a position corresponding to the current simulation time and after any processes with the same event time.

Parameters:
p - The process to be reactivated.
at - The reference at.
t - The event time.
 o reactivate
 public static final void reactivate(simulation.process.Process p,
                                     simulation.process.Process.At at,
                                     double t,
                                     simulation.process.Process.Prior prior)
Causes the specified process to become active at the specified event time (before processes with the same event time).

The process is positioned in the event list at a position corresponding to the current simulation time and before any processes with the same event time.

Parameters:
p - The process to be reactivated.
at - The reference at.
t - The event time.
prior - The constant prior.
 o reactivate
 public static final void reactivate(simulation.process.Process p,
                                     simulation.process.Process.Delay delay,
                                     double t)
Causes the specified process to become active after the specified delay (after processes with the same event time).

The process is positioned in the event list at a position corresponding to the current simulation time plus the the specified delay. The process is inserted after any processes with the same event time.

Parameters:
p - The process to be reactivated.
delay - The reference delay.
t - The delay.
 o reactivate
 public static final void reactivate(simulation.process.Process p,
                                     simulation.process.Process.Delay d,
                                     double t,
                                     simulation.process.Process.Prior prior)
Causes the specified process to become active after the specified delay (before processes with the same event time).

The process is positioned in the event list at a position corresponding to the current simulation time plus the the specified delay. The process is positioned in the event list before any processes with the same event time.

Parameters:
p - The process to be reactivated.
delay - The reference delay.
t - The event time.
prior - The reference prior.
 o reactivate
 public static final void reactivate(simulation.process.Process p1,
                                     simulation.process.Process.Before before,
                                     simulation.process.Process p2)
Schedules the first process immediately before the second one and at the same event time.

The process p1 is positioned in the event list immediately before the process p2 and with the same event time. If p1 == p2 or p2 is not in the event list, the call is equivalent to cancel(p1).

Parameters:
p1 - The process to be reactivated.
before - The reference before.
p2 - The process before which p1 is to be scheduled.
 o reactivate
 public static final void reactivate(simulation.process.Process p1,
                                     simulation.process.Process.After after,
                                     simulation.process.Process p2)
Schedules the first process immediately after the second one and at the same event time.

The process p1 is positioned in the event list immediately after the process p2 and with the same event time. If p1 == p2 or p2 is not in the event list, the call is equivalent to cancel(p1).

Parameters:
p1 - The process to be reactivated.
before - The reference after.
p2 - The process before which p1 is to be scheduled.

All Packages  Class Hierarchy  This Package  Previous  Next  Index