|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.simevents.Continuous
public abstract class Continuous
Continuous
Represents a variable in a continuous-time simulation. This abstract class provides the basic structures and tools for continuous-time simulation, where certain variables evolve continuously in time, according to differential equations. Such continuous variables can be mixed with events and processes.
Each type of continuous-time variable should be defined as a subclass of Continuous. The instances of these subclasses are the actual continuous-time variables. Each subclass must implement the method derivative which returns its derivative with respect to time. The trajectory of this variable is determined by integrating this derivative. The subclass may also reimplement the method afterEachStep, which is executed immediately after each integration step. It would probably be better if we could change this method when calling StartInteg, as in SIMOD.... By default (in the class Continuous), this method does nothing. This method could, for example, verify if the variable has reached a given threshold, or update a graphical illustration of the variable trajectory.
When creating a class representing a continuous variable, the toString method can be overridden to display information about the continuous variable. This information will be displayed when formating the event list as a string.
Each continuous variable has a linked simulator represented by an instance of the Simulator class. If no simulator is provided explicitly when constructing a variable, the default simulator returned by Simulator.getDefaultSimulator is used.
Constructor Summary | |
---|---|
Continuous()
. |
|
Continuous(Simulator sim)
. |
Method Summary | |
---|---|
void |
afterEachStep()
. |
abstract double |
derivative(double t)
. |
void |
init(double val)
. |
static void |
selectEuler(double h)
. |
static void |
selectRungeKutta2(double h)
. |
static void |
selectRungeKutta4(double h)
. |
void |
setSimulator(Simulator sim)
. |
Simulator |
simulator()
. |
void |
startInteg()
. |
void |
startInteg(double val)
. |
void |
stopInteg()
. |
double |
value()
. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Continuous()
public Continuous(Simulator sim)
Method Detail |
---|
public void init(double val)
public double value()
public Simulator simulator()
public void setSimulator(Simulator sim)
public void startInteg()
public void startInteg(double val)
public void stopInteg()
public abstract double derivative(double t)
public void afterEachStep()
public static void selectEuler(double h)
public static void selectRungeKutta4(double h)
public static void selectRungeKutta2(double h)
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |