All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jDisco.Continuous

java.lang.Object
   |
   +----jDisco.Linkage
           |
           +----jDisco.Link
                   |
                   +----jDisco.Continuous

public abstract class Continuous
extends jDisco.Link
This class may be used to describe the continuous processes of a model.

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.

See Also:
jDisco.Process, jDisco.Link, jDisco.Head

Constructor Index

 o Continuous()

Method Index

 o derivatives()
The differential and/or difference equations associated with this continuous process.
 o getPriority()
Returns the priority.
 o isActive()
Tests if this continuous process is active.
 o setPriority(double)
Sets the priority of this continuous process.
 o start()
Starts this continuous process.
 o stop()
Stops this continuous process.
 o time()
Returns the current simulation time.

Constructors

 o Continuous
 public Continuous()

Methods

 o derivatives
 protected abstract void derivatives()
The differential and/or difference equations associated with this continuous process.

 o isActive
 public boolean isActive()
Tests if this continuous process is active.

Returns:
true if this process is currently in the list of active continuous processes; false otherwise.
 o start
 public jDisco.Continuous start()
Starts this continuous process.

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.

Returns:
this.
 o stop
 public void stop()
Stops this continuous process.

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.

 o getPriority
 public double getPriority()
Returns the priority.

 o setPriority
 public jDisco.Continuous setPriority(double p)
Sets the priority of this continuous process.

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.

Parameters:
p - the new priority.
Returns:
this.
 o time
 public static double time()
Returns the current simulation time.


All Packages  Class Hierarchy  This Package  Previous  Next  Index