All Packages Class Hierarchy This Package Previous Next Index
Interface berkeley.cs.dmc.system.DynamicsSystem
- public interface DynamicsSystem
The DynamicsSystem interface is intended to provide a description of
a dynamical system sufficient for that system to be analysed by
transformation software, either the dynamics compiler of the periodic
system compiler.
-
CLOSED_FORM
- Constant to indicate that a state variable is evaluated as
a closed form function of time, and hence requires no analysis.
-
FIRST_DERIVATIVE
- Constant to indicate that a state variable represents the first
derivative of the preceeding variable int he array with respect
to time.
-
ITERATIVE
- Constant to indicate that a state variable is evaluated
using some interative method, such as numerical integration.
-
SECOND_DERIVATIVE
- Constant to indicate that a state variable represents the
second derivative of an earlier state variable with respect to
time.
-
bufferSize()
- Return the number of time values that should be buffered.
-
bufferStep()
- Return the time between buffered values that should be used.
-
checkState(double, double[], boolean)
- Test the quality of an approximation.
-
evaluate(double, double[], double, double[])
- Evaluate the system from t_last, where it had state variables p_last,
to t_now and state variables p_now.
-
evaluateFields(double, double[], float[])
- Given the state variables and time, fill in the field values.
-
evaluationTechnique(int)
- Return the evaluation techniques for each variable.
-
getBound(int)
- Get the bound for a given variable index.
-
initialCondition(double[])
- Provide an initial condition in p.
-
isCyclic(int)
- Return an array indicating which dimensions of the phase space
are cyclic.
-
maxApproxError()
- Return the maximum allowable error in an approximation.
-
mixDiff()
- Return the difference between distributions required to measure
mixing in determining the sampling threshold.
-
mixTestMax()
- Return the threshold for the number of cells that should be tested
for the sampling threshold.
-
numFields()
- Fields are the things that actually drive animations.
-
numVariables()
-
-
period()
-
-
resolutions()
- Return the resolutions of each variable.
-
subsetLength()
- Return the length of subsets with identical behaviour.
CLOSED_FORM
public static final int CLOSED_FORM
- Constant to indicate that a state variable is evaluated as
a closed form function of time, and hence requires no analysis.
ITERATIVE
public static final int ITERATIVE
- Constant to indicate that a state variable is evaluated
using some interative method, such as numerical integration.
FIRST_DERIVATIVE
public static final int FIRST_DERIVATIVE
- Constant to indicate that a state variable represents the first
derivative of the preceeding variable int he array with respect
to time.
SECOND_DERIVATIVE
public static final int SECOND_DERIVATIVE
- Constant to indicate that a state variable represents the
second derivative of an earlier state variable with respect to
time. It is assumed the basic variable is that appearing 2 previous
in the state vector.
numVariables
public abstract int numVariables()
- Returns:
- The number of state variables for the system.
numFields
public abstract int numFields()
- Fields are the things that actually drive animations. It may
be that the state variables are best for describing state, but
don't correspond to geometric transformation. In such cases,
use fields. Note also that derivatives frequently appear as
state variables, but rarely as fields.
- Returns:
- the number of fields used to set transforms.
subsetLength
public abstract int subsetLength()
- Return the length of subsets with identical behaviour. This
number should be a divisor of the total number of variables.
- Returns:
- The length of indentically behaved subsets.
evaluationTechnique
public abstract int evaluationTechnique(int ind)
- Return the evaluation techniques for each variable.
ind will be less than subsetLength().
- Parameters:
- ind - The index of the variable in question.
- Returns:
- One of CLOSED_FORM, ITERATIVE, FIRST_DERIVATIVE
or SECOND_DERIVATIVE
period
public abstract double period()
- Returns:
- The period of any driving function, if one exists.
0 if none exists.
isCyclic
public abstract boolean isCyclic(int ind)
- Return an array indicating which dimensions of the phase space
are cyclic. ind will be less than subsetLength(). By cyclic we mean
they wrap around modulo some number, such as an angle can be measured
modulo 2*PI. So any angular values should return true. Basically
this makes bounding easier.
- Parameters:
- ind - The index of the state variable in question.
- Returns:
- True if the variable can be measured modulo somthing.
getBound
public abstract double[] getBound(int ind)
- Get the bound for a given variable index.
ind will be less than subsetLength(). This method will only be called
for state variables that are cyclic, as given by isCyclic().
- Parameters:
- ind - The index of the variable in question.
- Returns:
- A 2d array, where the first element is the min and the
second the max.
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.
evaluate
public abstract float evaluate(double t_last,
double p_last[],
double t_now,
double p_now[])
- Evaluate the system from t_last, where it had state variables p_last,
to t_now and state variables p_now. p_last and p_now are the full
set of state variables. The value returned should be the percentage of
the maximum amount of work for a given frame. Returning 1.0 indicates
that no more work should be done for this system this frame, while
0.1 indicates that 10 times more work could be done.
- Parameters:
- t_last - The time for the last set of state variables.
- p_last - The set of state variables at time t_last.
- t_now - The time to evaluate the state variables.
- p_now - The array to be filled with the new state variable values.
- Returns:
- 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.
checkState
public abstract boolean checkState(double t,
double p[],
boolean discard)
- Test the quality of an approximation. This routine is free to modify
the value before returning. The third argument is true if the
value can be discarded. In this case, the function should return true
if the value is usable, and false if it should be discarded.
p wil be the full set of state variables, and t is the evaluation time.
- Parameters:
- t - The time for the given state.
- p - The state variables. The method may modify these.
- discard - True if the method may discard the given state completely.
- Returns:
- True if the value is usable, False if it should be discarded.
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
resolutions
public abstract double[] resolutions()
- Return the resolutions of each variable. This defines the resolution
of the cell decomposition used for approximation. Higher resolutions
means better approximations, but much more memory used and bigger
final file sizes.
- Returns:
- An array giving the resolution of each state variable.
mixTestMax
public abstract double mixTestMax()
- Return the threshold for the number of cells that should be tested
for the sampling threshold. N cells will be tested, where the sum of the
probability of the N cells is the smallest number greater than the
value returned by this function.
- Returns:
- The amount of probability density to test for the sampling
threshold.
mixDiff
public abstract double mixDiff()
- Return the difference between distributions required to measure
mixing in determining the sampling threshold. Higher values means
a weaker test, and smaller files and more efficient dynamics, but
with looser approximations. Lower values make the test harder.
- Returns:
- The minimum distance, between 0 and 1.
maxApproxError
public abstract double maxApproxError()
- Return the maximum allowable error in an approximation. Smaller
values give better results. The error of an approximation is
the sum of the squared error for each scaled sample. In other
samples are scaled between 0-1, the approximation is scaled identically,
then the difference is computed, squared and added to the total.
You can always set this value to be very low and stop the approximation
learning by hand when you are happy with the quality.
- Returns:
- The maximum approximation error.
All Packages Class Hierarchy This Package Previous Next Index