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
-
after
-
-
at
-
-
before
-
-
delay
-
-
prior
-
-
Process()
-
-
activate(Process)
- Causes the specified passive process to become active
at the current simulation time (after processes with the
same event time).
-
activate(Process, Process.After, Process)
- Schedules the first (passive) process immediately after
the second (scheduled) one, and at the same event time.
-
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).
-
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).
-
activate(Process, Process.Before, Process)
- Schedules the first (passive) process immediately before
the second (scheduled) one, and at the same event time.
-
activate(Process, Process.Delay, double)
- Causes the specified passive process to become active
after the specified delay (after processes with the
same event time).
-
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).
-
cancel(Process)
- Cancels a scheduled event.
-
current()
- Returns the currently active process.
-
evTime()
- Returns the event time of this process.
-
hold(double)
- Suspends the currently active process for a specified
period of simulated time.
-
idle()
- Tests if this process is scheduled.
-
main()
- Returns the main process.
-
nextEv()
- Returns the next process (if any) in the event list.
-
passivate()
- Passivates the currently active process.
-
reactivate(Process)
- Causes the specified process to become active
at the current simulation time (after processes with the
same event time).
-
reactivate(Process, Process.After, Process)
- Schedules the first process immediately after
the second one and at the same event time.
-
reactivate(Process, Process.At, double)
- Causes the specified process to become active
at the specified event time (after processes with the
same event time).
-
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).
-
reactivate(Process, Process.Before, Process)
- Schedules the first process immediately before
the second one and at the same event time.
-
reactivate(Process, Process.Delay, double)
- Causes the specified process to become active
after the specified delay (after processes with the
same event time).
-
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).
-
terminated()
- Tests if this process is terminated.
-
time()
- Returns the current simulation time.
-
wait(Head)
- Causes the currently active process to wait in a queue.
at
public static final simulation.process.Process.At at
delay
public static final simulation.process.Process.Delay delay
before
public static final simulation.process.Process.Before before
after
public static final simulation.process.Process.After after
prior
public static final simulation.process.Process.Prior prior
Process
public Process()
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.
terminated
public final boolean terminated()
- Tests if this process is terminated.
- Returns:
- true if this process has executed
all its actions; false otherwise.
evTime
public final double evTime()
- Returns the event time of this process.
- Throws: RuntimeException
- if this process is idle.
nextEv
public final simulation.process.Process nextEv()
- Returns the next process (if any) in the event list.
current
public static final simulation.process.Process current()
- Returns the currently active process.
time
public static final double time()
- Returns the current simulation time.
main
public static final simulation.process.Process main()
- Returns the main process.
The main process is the first process activated
in a simulation.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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