Class Rk4Naive
java.lang.Object
Rk4Naive
- All Implemented Interfaces:
- INumericalIntegrator
public class Rk4Naive
- extends java.lang.Object
- implements INumericalIntegrator
Naive implementation of RK4 (4th order Runge Kutta integration)
for handling continuous-time components of distributed control
simulation.
- Since:
- 1.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Rk4Naive
protected Rk4Naive()
Rk4Naive
public Rk4Naive(double lfStepSize)
integrateUntil
public double integrateUntil(double lfTimeStop,
double lfTCurr,
double[] arrLfState,
double[] arrLfDerivScratch,
IAgent agent,
StateBundle[] arrStates,
ISensor[] arrSensors,
IEnvironment env,
ISimUICallback drawCallback,
ISimUICallback haltCallback)
- Assumes that time does not step over an agent
state change event.
Other classes should handle this constraint.
- Specified by:
integrateUntil
in interface INumericalIntegrator
- Parameters:
lfTimeStop
- integrate until this time.lfTCurr
- current (start) timearrLfState
- state vector (initially initial state,
overwritten with final state)arrLfDerivScratch
- state derivative vector scratch space
(should be same dimensionality as state vector)agent
- agent mapping (currently only support for homogenous swarms
)arrStates
- state of each agent (assumed
not to change over integration)arrSensors
- array of sensor interfaces.drawCallback
- callback for drawing routines (if any)
(can be null)haltCallback
- callback to check if we should halt
(can be null)env
- environment
- Returns:
- actual absolute (simulation)
time at which we stopped integration, whether due to an
interruption, or concluding the computation (lfTimeStop).