All Packages Class Hierarchy This Package Previous Next Index
Class jDisco.Process
java.lang.Object
|
+----jDisco.Linkage
|
+----jDisco.Link
|
+----jDisco.Continuous
|
+----jDisco.Process
- public abstract class Process
- extends jDisco.Continuous
This class may be used to describe the processes of a model.
The discrete processes of a system are described by means of class Process.
Outline:
public abstract class Process {
protected abstract void actions();
public static double time();
public static void activate(Process p);
public static void hold(double t);
public static void passivate();
public static void wait(Head q);
public static void waitUntil(Condition cond);
public double dtMin, dtMax;
public double maxAbsError, maxRelError;
}
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.
A process may be suspended temporarily and may be resumed later from where it left off.
The activate method is used to make a specified process start
executing its actions.
The hold method suspends the execution of the calling process for
a specified period of time.
The passivate method suspends the execution of the calling process
for an unknown period of time. Its execution may later be resumed by calling
activate with the process as argument.
The wait method suspends the calling process and adds it to a queue.
The waitUntil method can be used to schedule a discrete event to occur
as soon as a prescribed system state is reached. Such an event is called a state-event,
in contrast to a time-event which is an event scheduled to occur at a
specified point in time.
Class Process extends class Continuous, allowing a
Process-object to represent a discrete as well as a continuous process.
Since Continuous 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:
- jDisco.Continuous, jDisco.Link, jDisco.Head
-
after
-
-
at
-
-
before
-
-
delay
-
-
dtMax
- The maximum allowable step-size.
-
dtMin
- The minimum allowable step-size.
-
maxAbsError
- The upper bound for the absolute error.
-
maxRelError
- The upper bound for the relative error.
-
prior
-
-
Process()
-
-
actions()
- The life cycle of this 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.
-
cancelStateEvent(Process)
- Causes the annulment of a state-event which might have been
planned by a process.
-
current()
- Returns the currently active process.
-
derivatives()
- Default version causing an error if the process is used as
a continuous process (started), but no derivatives
method has been specified.
-
dt()
- Returns the current integration stepsize.
-
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.
-
integrationMethod(String)
- Chooses one of the built-in integration methods.
-
lastTime()
- Returns the starting point of the current time step.
-
main()
- Returns the main process.
-
nextEv()
- Returns the next process (if any) in the event list.
-
passivate()
- Passivates the currently active process.
-
pause()
- Reactives the currently active process after the monitor.
-
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.
-
waitUntil(Condition)
- Suspends the currently active process until a specified condition
becomes true.
-
waitUntil(Condition, double)
- Suspends the currently active process until a specified condition
becomes true.
-
waitUntil(Condition, double, Process.Prior)
- Suspends the currently active process until a specified condition
becomes true.
-
waitUntil(Condition, Process.Prior)
- Suspends the currently active process until a specified condition
becomes true.
at
public static final jDisco.Process.At at
delay
public static final jDisco.Process.Delay delay
before
public static final jDisco.Process.Before before
after
public static final jDisco.Process.After after
prior
public static final jDisco.Process.Prior prior
dtMin
public static double dtMin
- The minimum allowable step-size.
During the simulation time advances in steps of variable size.
The step-size, among other things, is governed by the event times
and the user's requirements regarding integration accuracy.
dtMin and dtMax are used to specify the minimum
and the maximum allowable step-size, respectively.
In general, step-size will vary within these bounds.
There are the following exceptions, however:
(1) A time step less than dtMin can be taken in order to
assure that a time-event is not passed.
(2) A time step greater than dtMax can be taken whenever
there are neither planned state-events nor active continuous processes.
In this case, step-size is as large as possible without passing a time-event.
dtMax
public static double dtMax
- The maximum allowable step-size.
maxAbsError
public static double maxAbsError
- The upper bound for the absolute error.
maxRelError
public static double maxRelError
- The upper bound for the relative error.
Process
public Process()
actions
protected abstract void actions()
- The life cycle of this process.
derivatives
protected void derivatives()
- Default version causing an error if the process is used as
a continuous process (started), but no derivatives
method has been specified.
- Overrides:
- derivatives in class jDisco.Continuous
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: DiscoException
- if this process is idle.
nextEv
public final jDisco.Process nextEv()
- Returns the next process (if any) in the event list.
current
public static final jDisco.Process current()
- Returns the currently active process.
time
public static final double time()
- Returns the current simulation time.
lastTime
public static final double lastTime()
- Returns the starting point of the current time step.
dt
public static final double dt()
- Returns the current integration stepsize.
main
public static final jDisco.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: DiscoException
- if the event list becomes empty.
wait
public static final void wait(jDisco.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: DiscoException
- if the event list becomes empty.
cancel
public static final void cancel(jDisco.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: DiscoException
- if the event list becomes empty.
activate
public static final void activate(jDisco.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(jDisco.Process p,
jDisco.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 constant at.
- t - the event time.
activate
public static final void activate(jDisco.Process p,
jDisco.Process.At at,
double t,
jDisco.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 constant at.
- t - the event time.
- prior - the reference constant prior.
activate
public static final void activate(jDisco.Process p,
jDisco.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 constant delay.
- t - the delay.
activate
public static final void activate(jDisco.Process p,
jDisco.Process.Delay d,
double t,
jDisco.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 constant delay.
- t - the event time.
- prior - the reference constant prior.
activate
public static final void activate(jDisco.Process p1,
jDisco.Process.Before before,
jDisco.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 constant before.
- p2 - the process before which p1
is to be scheduled.
activate
public static final void activate(jDisco.Process p1,
jDisco.Process.After after,
jDisco.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 reference constant after.
- p2 - the process after which p1
is to be scheduled.
reactivate
public static final void reactivate(jDisco.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(jDisco.Process p,
jDisco.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 constant at.
- t - the event time.
reactivate
public static final void reactivate(jDisco.Process p,
jDisco.Process.At at,
double t,
jDisco.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 constant at.
- t - the event time.
- prior - the reference constant prior.
reactivate
public static final void reactivate(jDisco.Process p,
jDisco.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(jDisco.Process p,
jDisco.Process.Delay d,
double t,
jDisco.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 constant delay.
- t - the event time.
- prior - the reference constant prior.
reactivate
public static final void reactivate(jDisco.Process p1,
jDisco.Process.Before before,
jDisco.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 constant before.
- p2 - the process before which p1.
is to be scheduled.
reactivate
public static final void reactivate(jDisco.Process p1,
jDisco.Process.After after,
jDisco.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 constant after.
- p2 - the process before which p1
is to be scheduled.
waitUntil
public void waitUntil(jDisco.Condition cond)
- Suspends the currently active process until a specified condition
becomes true.
The method may be used to define state-events, that is, events whose time
of occurrence is dependent upon a given state-condition.
waitUntil(cond), where cond is a Condition-object,
causes the active discrete process, current, to become passive
(idle) over a period which is planned to last until the
test-method of cond evaluates to true.
However, this passive period will end sooner if the waiting process
is activated by another discrete process.
It is possible to schedule a time-event for a waiting process, so that
the process has simultaneously a state-event and a time-event scheduled
(e.g., activate(p, delay, 10), where p is a waiting
Process-object). When the first of these events takes place,
the other one will be annulled.
A state-event takes place as soon as the corresponding state-condition
is fulfilled. The event time will be determined with an accuracy of dtMin.
Discrete processes operate in quasi-parallel, which means that "simultaneous"
events occur in a certain order. With regard to simultaneous events,
the following rules apply:
(1) Time-events take place before state-events
(2) Time-events take place in their scheduled order, that is to say,
in the same sequence as they are represented in the list of event notices
(3) State-events take place in accordance with their priorities (high-value-first).
The call waitUntil(cond) is equivalent to the call
waitUntil(cond, 0, null).
A state-event takes place only if its condition is true.
Notice that the occurrence of a simultaneous event can change the
condition's truth value.
waitUntil must only be called by a discrete process.
Violating this rule leads to the error message
Illegal call of waitUntil
after which the simulation is stopped.
- Parameters:
- cond - the condition.
- See Also:
- jDisco.Condition, waitUntil, waitUntil, waitUntil
waitUntil
public void waitUntil(jDisco.Condition cond,
double waitPriority)
- Suspends the currently active process until a specified condition
becomes true.
The call waitUntil(cond, waitPriority) is equivalent to the call
waitUntil(cond, waitPriority, null).
- Parameters:
- cond - the condition.
- waitPriority - the priority.
- See Also:
- jDisco.Condition, waitUntil, waitUntil, waitUntil
waitUntil
public void waitUntil(jDisco.Condition cond,
jDisco.Process.Prior prior)
- Suspends the currently active process until a specified condition
becomes true.
The call waitUntil(cond, prior) is equivalent to the call
waitUntil(cond, 0, prior).
- Parameters:
- cond - the condition.
- prior - the reference constant prior.
- See Also:
- jDisco.Condition, waitUntil, waitUntil, waitUntil
waitUntil
public void waitUntil(jDisco.Condition cond,
double waitPriority,
jDisco.Process.Prior prior)
- Suspends the currently active process until a specified condition
becomes true.
The parameter waitPriority is the priority of the state-event.
The parameter prior is used to specify whether the state-event
should take place befor (prior != null) or after
(prior == null) any other state-event with the same priority.
The process is inserted into the wait list at a position corresponding
to its waitPriority, and, if prior != null,
before any waiting processes with the same priority;
otherwise after.
- Parameters:
- cond - the condition.
- waitPriority - the priority.
- prior - the reference constant prior or null.
- See Also:
- jDisco.Condition, waitUntil, waitUntil, waitUntil
cancelStateEvent
public void cancelStateEvent(jDisco.Process p)
- Causes the annulment of a state-event which might have been
planned by a process.
cancelStateEvent must only be called by a discrete process.
Violating this rule leads to the error message
Illegal call of cancelStateEvent
after which the simulation is stopped.
- Parameters:
- p - the process.
- See Also:
- waitUntil
pause
public void pause()
- Reactives the currently active process after the monitor.
integrationMethod
public void integrationMethod(java.lang.String name)
- Chooses one of the built-in integration methods.
If no such method exists, the following error message is printed
Illegal call of integrationMethod (class Process)
after which the simulation is stopped.
- Parameters:
- name - the name of the integration method.
- Throws: DiscoException
- if name is not a built-in integration method.
All Packages Class Hierarchy This Package Previous Next Index