com.yobotics.simulationconstructionset.util.statemachines
Class StateMachine<E extends java.lang.Enum<E>>
java.lang.Object
com.yobotics.simulationconstructionset.util.statemachines.StateMachine<E>
- All Implemented Interfaces:
- TimeInCurrentStateProvider
public class StateMachine<E extends java.lang.Enum<E>>
- extends java.lang.Object
- implements TimeInCurrentStateProvider
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StateMachine
public StateMachine(java.lang.String name,
java.lang.String switchTimeName,
java.lang.Class<E> enumType,
DoubleYoVariable t,
YoVariableRegistry registry)
getStateYoVariableName
public java.lang.String getStateYoVariableName()
getSwitchTimeName
public java.lang.String getSwitchTimeName()
attachStateChangedListener
public void attachStateChangedListener(StateChangedListener<E> listener)
addState
public void addState(State<E> state)
setCurrentState
public void setCurrentState(E nextStateEnum)
isCurrentState
public boolean isCurrentState(E stateEnum)
timeInCurrentState
public double timeInCurrentState()
- Specified by:
timeInCurrentState
in interface TimeInCurrentStateProvider
inCurrentStateForDuration
public boolean inCurrentStateForDuration(double duration)
doAction
public void doAction()
getCurrentState
public State<E> getCurrentState()
getCurrentStateEnum
public E getCurrentStateEnum()
getState
public State<E> getState(E stateEnum)
checkTransitionConditions
public void checkTransitionConditions()
checkTransitionConditionsThoroughly
public void checkTransitionConditionsThoroughly()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getStateYoVariable
public EnumYoVariable<E> getStateYoVariable()
packStateMachineStateVector
public void packStateMachineStateVector(StateMachineStateVector<E> stateMachineStateVector)