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.


Method Index

 o bufferSize()
Return the number of time values that should be buffered.
 o bufferStep()
Return the time between buffered values that should be used.
 o evaluateFields(double, double[], float[])
Given the state variables and time, fill in the field values.
 o initialCondition(double[])
Provide an initial condition in p.
 o newState(double, double[], double, double[], double, double[])
Generate a state update, given the old state and time.
 o numFields()
 o numVariables()

Methods

 o numVariables
 public abstract int numVariables()
Returns:
The number of state variables in the system.
 o numFields
 public abstract int numFields()
Returns:
The number of fields used to set transforms.
 o 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.
 o 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
 o 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.
 o 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.
 o 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