All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----jDisco.Linkage | +----jDisco.Link | +----jDisco.Continuous
The continuous state changes are described in one or more subclasses of class Continuous, so that objects of these subclasses through their derivatives method compute the current values or derivatives of state variables.
Example:
class Dymamics extends Continuous { public void derivatives() { x.rate = -x.state * time(); } }
It is the user's responsibility to make sure that the sequence of these computations is correct so that the quantities involved always reflect the current state of the model. Sometimes the sequence may be decisive for correct model behaviour. This applies for example when a Variable-object's rate appears on the right-hand side of an assignment statement. Execution of the active continuous processes is governed by a sequence of decreasing priorities (high-value-first). Processes with equal priorities are executed according to when they became active (earliest-first).
Only continuous changes may be described with class Continuous. All discrete state changes should be handled by discrete processes (Process-objects).
Since Continuous is a subclass of Link, every continuous process has the capability of being a member of a two-way list.
public Continuous()
protected abstract void derivatives()
public boolean isActive()
public jDisco.Continuous start()
The object is inserted into the list of active continuous processes. Its place in the list is determined by the priority value of the object, priority (high-value-first). If there are other objects with the same priority value, then the object in question is inserted after the others.
Calling start when the object is already active has no effect.
Note that each object is inactive until its start-method is called.
start may only be called by a discrete process. Violating this rule leads to the error message
Illegal call of start (class Continuous)
after which the simulation is stopped.
start returns a reference to this Continuous-object. This allows the user to write as follows:
Dynamics d = new Dynamics().start();
where Dynamics is a subclass of class Continuous.
public void stop()
stop removes the object from the list of active continuous processes.
Calling stop has no effect unless the object is active.
stop may only be called by a discrete process.Violating this rule leads to the error message
Illegal call of stop (class Continuous)
after which the simulation is stopped.
public double getPriority()
public jDisco.Continuous setPriority(double p)
The list of active continuous processes is ordered according to decreasing priority values (high-value-first). Calling setPriority(p) sets the object's priority to p.
The priority may be changed as often as necessary. Each continuous process has priority zero until its setPriority-methods is called.
setPriority may be called not only when the object is active, but also when it is inactive. However, setPriority may only be called by a discrete process. Violating this rule leads to the error message
Illegal call of setPriority (class Continuous)
after which the simulation is stopped.
setPriority returns a reference to this Continuous-object. This allows the user to write as follows:
new Derivatives().setPriority(2).start();
where Derivatives is a subclass of class Continuous.
public static double time()
All Packages Class Hierarchy This Package Previous Next Index