uchicago.src.sim.math
Class CEquationFactory

java.lang.Object
  extended by uchicago.src.sim.math.CEquationFactory

public class CEquationFactory
extends java.lang.Object

Factory for creating CEquations and automatically scheduling their evaluate and assignment at some specified interval. All equations scheduled for the same tick will be evaluated and then they will all be assigned. The order of evaluation between is undetermined and so it is expected that the equations can be evaluated in any order without producing side-effects.

Version:
$Revision: 1.6 $ $Date: 2005/08/12 16:13:29 $
Author:
Nick Collier

Constructor Summary
CEquationFactory(Schedule schedule)
          Creates a CEquationFactory.
 
Method Summary
 CEquation createEquation(java.lang.Object target, java.lang.String equation, java.lang.String resultVar, double updateInterval)
          Creates and schedule a CEquation.
 CEquation createEquation(java.lang.Object target, java.lang.String equation, java.lang.String resultVar, double initialDTValue, double updateInterval)
          Creates and schedule a CEquation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CEquationFactory

public CEquationFactory(Schedule schedule)
Creates a CEquationFactory.

Parameters:
schedule - the schedule against which to schedule created CEquations evaluation and assignment
Method Detail

createEquation

public CEquation createEquation(java.lang.Object target,
                                java.lang.String equation,
                                java.lang.String resultVar,
                                double updateInterval)
Creates and schedule a CEquation.

Parameters:
target - the target from which the equations variable values are read and to which the result is assigned
equation - the equation to evaluate.
resultVar - the name of the variable to assign the result to
updateInterval - the interval at which to evaluate and assign the created CEquation
Returns:
the created CEquation.
See Also:
CEquation

createEquation

public CEquation createEquation(java.lang.Object target,
                                java.lang.String equation,
                                java.lang.String resultVar,
                                double initialDTValue,
                                double updateInterval)
Creates and schedule a CEquation.

Parameters:
target - the target from which the equations variable values are read and to which the result is assigned
equation - the equation to evaluate.
resultVar - the name of the variable to assign the result to
initialDTValue - the initial value of dt to use on the first evaluation when it would otherwise be set to 0
updateInterval - the interval at which to evaluate and assign the created CEquation
Returns:
the created CEquation.
See Also:
CEquation