All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jDisco.Variable

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

public class Variable
extends jDisco.Link
This class is used to represent state variables that vary between discrete events according to ordinary first-order differential equations and/or difference equations.

These equations are expressed in subclasses of class Continous.

See Also:
jDisco.Continuous

Variable Index

 o rate
The derivative with respect to time.
 o state
The current value of the variable.

Constructor Index

 o Variable(double)
Contructs a variable with an initial value of initialState.

Method Index

 o isActive()
Tests if this variable is active.
 o lastState()
Returns the value of state at the starting point of the current step.
 o start()
Starts this variable.
 o stop()
Stops this variable.

Variables

 o state
 public double state
The current value of the variable.

 o rate
 public double rate
The derivative with respect to time.

Constructors

 o Variable
 public Variable(double initialState)
Contructs a variable with an initial value of initialState.

Parameters:
initialState - the initial value.

Methods

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

Returns:
true if the variable is currently in the list of active variables; false otherwise.
 o start
 public jDisco.Variable start()
Starts this variable.

The objcet is inserted into the list of active Variable-objects.

Calling start when the object is already active has no effect. Note that each Variable-object is inactive until its start-method has been called.

start may only be called by a discrete process. Violating this rule leads to the error message

 
     Illegal call of start (class Variable)
after which the simulation is stopped.

start returns a reference to this Variable-object. This allows the user to write as follows:

 
     Variable v = new Variable(1234).start();

Returns:
this
 o stop
 public void stop()
Stops this variable.

stop removes the object from the list of active Variable-objects.

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 Variable)
after which the simulation is stopped.

 o lastState
 public double lastState()
Returns the value of state at the starting point of the current step.

lastState may be used to describe continuous changes defined by difference equations.


All Packages  Class Hierarchy  This Package  Previous  Next  Index