Package repast.simphony.statecharts
Class DefaultStateChart<T>
java.lang.Object
repast.simphony.statecharts.DefaultStateChart<T>
- All Implemented Interfaces:
StateChart<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<Transition<T>>protected List<Transition<T>>protected SimpleState<T>protected List<Transition<T>>protected List<Transition<T>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultStateChart(T agent) Creates DefaultStateChart for the specified agent and sets whether or not the agent needs to be in a Context for the statechart to function. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateState(String stateID) Activates the state (identified by a potentially non-unique ID) if it exists.voidactivateState(AbstractState<T> state) Activates the state if it exists.protected voidaddRegularTransition(Transition<T> transition) protected voidaddSelfTransition(SelfTransition<T> transition) protected voidaddState(AbstractState<T> state) voidbegin(StateChartSimIntegrator integrator) Begin state chart.voidfollowTransition(String transitionID) Follow the transition (identified by a potentially non-unique ID) if valid.voidfollowTransition(Transition<T> transition) Follow the transition if valid.getAgent()Gets the agent associated with this StateChart.Retrieve current state.protected ParametersdoublegetQueue()getStateForUuid(String uuid) Returns the state associated with the uuid or null if not found.getTransitionForUuid(String uuid) Returns the transition associated with the uuid or null if not found.protected TransitionResolutionStrategygetUuidForState(AbstractState<T> state) protected voidputStateUuid(AbstractState<T> state, String uuid) protected voidputTransitionUuid(Transition<T> transition, String uuid) voidreceiveMessage(Object message) Receive a message into the statechart queue.protected voidregisterEntryState(AbstractState<T> state) voidprotected voidremoveResolveTime(double nextTime) voidvoidresolve()protected voidscheduleResolveTime(double nextTime) protected voidsetPriority(double priority) protected voidsetStateUuidMap(Map<AbstractState<T>, String> stateUuidMap) protected voidsetTransitionResolutionStrategy(TransitionResolutionStrategy transitionResolutionStrategy) protected voidsetTransitionUuidMap(Map<Transition<T>, String> transitionUuidMap) voidstop()Stops this statechart.booleanwithinState(String id)
-
Field Details
-
regularTransitions
-
activeRegularTransitions
-
selfTransitions
-
activeSelfTransitions
-
currentSimpleState
-
-
Constructor Details
-
DefaultStateChart
Creates DefaultStateChart for the specified agent and sets whether or not the agent needs to be in a Context for the statechart to function.- Parameters:
agent-contextRequired-
-
-
Method Details
-
getTransitionResolutionStrategy
-
setTransitionResolutionStrategy
protected void setTransitionResolutionStrategy(TransitionResolutionStrategy transitionResolutionStrategy) -
setStateUuidMap
-
putStateUuid
-
setTransitionUuidMap
-
putTransitionUuid
-
registerEntryState
-
begin
Description copied from interface:StateChartBegin state chart.- Specified by:
beginin interfaceStateChart<T>
-
stop
public void stop()Stops this statechart.- Specified by:
stopin interfaceStateChart<T>
-
addState
-
addRegularTransition
-
addSelfTransition
-
getCurrentSimpleState
Description copied from interface:StateChartRetrieve current state.- Specified by:
getCurrentSimpleStatein interfaceStateChart<T>- Returns:
-
resolve
public void resolve()- Specified by:
resolvein interfaceStateChart<T>
-
scheduleResolveTime
protected void scheduleResolveTime(double nextTime) -
removeResolveTime
protected void removeResolveTime(double nextTime) -
getQueue
-
receiveMessage
Description copied from interface:StateChartReceive a message into the statechart queue.- Specified by:
receiveMessagein interfaceStateChart<T>
-
getPriority
public double getPriority()- Specified by:
getPriorityin interfaceStateChart<T>
-
setPriority
protected void setPriority(double priority) -
getAgent
Description copied from interface:StateChartGets the agent associated with this StateChart.- Specified by:
getAgentin interfaceStateChart<T>- Returns:
- the agent associated with this StateChart.
-
getParams
-
withinState
- Specified by:
withinStatein interfaceStateChart<T>
-
getCurrentStates
- Specified by:
getCurrentStatesin interfaceStateChart<T>
-
getUuidForState
- Specified by:
getUuidForStatein interfaceStateChart<T>
-
getStateForUuid
Description copied from interface:StateChartReturns the state associated with the uuid or null if not found.- Specified by:
getStateForUuidin interfaceStateChart<T>- Returns:
-
getTransitionForUuid
Description copied from interface:StateChartReturns the transition associated with the uuid or null if not found.- Specified by:
getTransitionForUuidin interfaceStateChart<T>- Returns:
-
registerStateChartListener
- Specified by:
registerStateChartListenerin interfaceStateChart<T>
-
removeStateChartListener
- Specified by:
removeStateChartListenerin interfaceStateChart<T>
-
activateState
Description copied from interface:StateChartActivates the state if it exists. Should be called when simulation is paused.- Specified by:
activateStatein interfaceStateChart<T>- Parameters:
state- the state to activate
-
activateState
Description copied from interface:StateChartActivates the state (identified by a potentially non-unique ID) if it exists.- Specified by:
activateStatein interfaceStateChart<T>- Parameters:
stateID- the potentially non-unique ID of the state to activate
-
followTransition
Description copied from interface:StateChartFollow the transition (identified by a potentially non-unique ID) if valid.- Specified by:
followTransitionin interfaceStateChart<T>- Parameters:
transitionID- the potentially non-unique ID of the transition to follow
-
followTransition
Description copied from interface:StateChartFollow the transition if valid. Should be called when simulation is paused.- Specified by:
followTransitionin interfaceStateChart<T>- Parameters:
transition- the transition to follow
-