All Packages Class Hierarchy This Package Previous Next Index
Interface berkeley.cs.dmc.system.DynamicsVariable
- public interface DynamicsVariable
The DynamicsVariable class is intended to provide a simple
standard interface between dynamical systems and VRML. Any
java classes used to animate geometry in the dmod modeller
must implement this interface.
-
bufferSize()
- Return the number of time values that should be buffered.
-
bufferStep()
- Return the time between buffered values that should be used.
-
evaluateFields(double, double[], float[])
- Given the state variables and time, fill in the field values.
-
initialCondition(double[])
- Provide an initial condition in p.
-
newState(double, double[], double, double[], double, double[])
- Generate a state update, given the old state and time.
-
numFields()
-
-
numVariables()
-
numVariables
public abstract int numVariables()
- Returns:
- The number of state variables in the system.
numFields
public abstract int numFields()
- Returns:
- The number of fields used to set transforms.
bufferStep
public abstract float bufferStep()
- Return the time between buffered values that should be used. This is
really a measure of how quickly the system changes state, because
continuous values will be linearly interpolated between buffered
values. Also, the system will be asked to evaluate over periods
that are multiples of the buffer step.
- Returns:
- The interval to use between values in the state buffer.
bufferSize
public abstract int bufferSize()
- Return the number of time values that should be buffered. The
more buffered, the less chance the system will be without state.
But more buffered means much more memory used.
- Returns:
- The number of state entries in the buffer
initialCondition
public abstract boolean initialCondition(double p[])
- Provide an initial condition in p. Returns true if this is a random
value. p will be the full set of parameters. This function should also
do burn in - ie the values returned are assumed to be typical for the
system. Finally, the values returned should be within their expected
bounds, particularly for cyclic variables.
- Parameters:
- p - Space for the initial condition. The method should fill this.
- Returns:
- True if the value is random, false if the same value will
always be returned.
newState
public abstract float newState(double last_time,
double last_params[],
double last_seen,
double seen_params[],
double new_time,
double new_params[])
- Generate a state update, given the old state and time. In practice,
last_time and last_params will be the most recent time the
system was evaluated, corresponding to the latest buffer values.
Last_seen will be the last time the system was seen by the viewer.
It will be less than or equal to last_time. The function should
fill the new_params corresponding to new_time, and return the
amount of work done, a number between 0 and 1 where 0 indicates
nothing was done and 1 indicates enough work was done for one
frame of the animation.
- Parameters:
- last_time - The last time the system state was evaluated.
- last_params - The state variables evaluated at last_time.
- last_seen - The last time the system was seen by a viewer.
- seen_params - The state variables evaluated at last_seen.
- new_time - The new time to evaluate state.
- new_params - The method should fill this array with the new
state variable values.
- Returns:
- A measure of the amount of work done, between 0 and 1.
evaluateFields
public abstract void evaluateFields(double t,
double params[],
float fields[])
- Given the state variables and time, fill in the field values.
- Parameters:
- t - The time corresponding to these values.
- params - The state variable values at time t.
- fields - The array of field values to be filled by the method.
All Packages Class Hierarchy This Package Previous Next Index