Package org.hipparchus.ode.events
Class StepEndEventState
- java.lang.Object
-
- org.hipparchus.ode.events.StepEndEventState
-
- All Implemented Interfaces:
EventState
public class StepEndEventState extends Object implements EventState
This class handles the state for oneevent handler
that triggers at step end.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description StepEndEventState(ODEStepEndHandler handler)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventOccurrence
doEvent(ODEStateAndDerivative state)
Notify the user's listener of the event.boolean
evaluateStep(ODEStateInterpolator interpolator)
Evaluate the impact of the proposed step on the handler.double
getEventTime()
Get the occurrence time of the event triggered in the current step.ODEStepEndHandler
getHandler()
Get the underlying step end handler.void
init(ODEStateAndDerivative s0, double t)
Initialize handler at the start of an integration.void
setStepEnd(double stepEnd)
Set the step end.
-
-
-
Constructor Detail
-
StepEndEventState
public StepEndEventState(ODEStepEndHandler handler)
Simple constructor.- Parameters:
handler
- step end handler
-
-
Method Detail
-
getHandler
public ODEStepEndHandler getHandler()
Get the underlying step end handler.- Returns:
- underlying step end handler
-
init
public void init(ODEStateAndDerivative s0, double t)
Initialize handler at the start of an integration.This method is called once at the start of the integration. It may be used by the handler to initialize some internal data if needed.
- Specified by:
init
in interfaceEventState
- Parameters:
s0
- initial statet
- target time for the integration
-
setStepEnd
public void setStepEnd(double stepEnd)
Set the step end.- Parameters:
stepEnd
- step end
-
evaluateStep
public boolean evaluateStep(ODEStateInterpolator interpolator)
Evaluate the impact of the proposed step on the handler.- Specified by:
evaluateStep
in interfaceEventState
- Parameters:
interpolator
- step interpolator for the proposed step- Returns:
- true if the event handler triggers an event before the end of the proposed step
-
getEventTime
public double getEventTime()
Get the occurrence time of the event triggered in the current step.- Specified by:
getEventTime
in interfaceEventState
- Returns:
- occurrence time of the event triggered in the current step or infinity if no events are triggered
-
doEvent
public EventOccurrence doEvent(ODEStateAndDerivative state)
Notify the user's listener of the event. The event occurs wholly within this method call including a call toODEEventHandler.resetState(ODEEventDetector, ODEStateAndDerivative)
if necessary.- Specified by:
doEvent
in interfaceEventState
- Parameters:
state
- the state at the time of the event. This must be at the same time as the current value ofEventState.getEventTime()
.- Returns:
- the user's requested action and the new state if the action is
Action.RESET_STATE
. Otherwise the new state isstate
. The stop time indicates what time propagation should stop if the action isAction.STOP
. This guarantees the integration will stop on or after the root, so that integration may be restarted safely.
-
-