Package repast.simphony.statecharts
Interface StateChart<T>
-
- All Known Implementing Classes:
DefaultStateChart
public interface StateChart<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activateState(String stateID)
Activates the state (identified by a potentially non-unique ID) if it exists.void
activateState(AbstractState<T> state)
Activates the state if it exists.void
begin(StateChartSimIntegrator integrator)
Begin state chart.void
followTransition(String transitionID)
Follow the transition (identified by a potentially non-unique ID) if valid.void
followTransition(Transition<T> transition)
Follow the transition if valid.T
getAgent()
Gets the agent associated with this StateChart.AbstractState<T>
getCurrentSimpleState()
Retrieve current state.List<AbstractState<T>>
getCurrentStates()
double
getPriority()
AbstractState<T>
getStateForUuid(String uuid)
Returns the state associated with the uuid or null if not found.Transition<T>
getTransitionForUuid(String uuid)
Returns the transition associated with the uuid or null if not found.String
getUuidForState(AbstractState<T> state)
void
receiveMessage(Object message)
Receive a message into the statechart queue.void
registerStateChartListener(StateChartListener scl)
void
removeStateChartListener(StateChartListener scl)
void
resolve()
void
stop()
Stops the state chart.boolean
withinState(String id)
-
-
-
Method Detail
-
receiveMessage
void receiveMessage(Object message)
Receive a message into the statechart queue.
-
getAgent
T getAgent()
Gets the agent associated with this StateChart.- Returns:
- the agent associated with this StateChart.
-
begin
void begin(StateChartSimIntegrator integrator)
Begin state chart.
-
stop
void stop()
Stops the state chart.
-
getCurrentSimpleState
AbstractState<T> getCurrentSimpleState()
Retrieve current state.- Returns:
-
withinState
boolean withinState(String id)
-
getCurrentStates
List<AbstractState<T>> getCurrentStates()
-
getUuidForState
String getUuidForState(AbstractState<T> state)
-
getStateForUuid
AbstractState<T> getStateForUuid(String uuid)
Returns the state associated with the uuid or null if not found.- Parameters:
uuid
-- Returns:
-
registerStateChartListener
void registerStateChartListener(StateChartListener scl)
-
removeStateChartListener
void removeStateChartListener(StateChartListener scl)
-
getTransitionForUuid
Transition<T> getTransitionForUuid(String uuid)
Returns the transition associated with the uuid or null if not found.- Parameters:
uuid
-- Returns:
-
activateState
void activateState(AbstractState<T> state)
Activates the state if it exists. Should be called when simulation is paused.- Parameters:
state
- the state to activate
-
followTransition
void followTransition(Transition<T> transition)
Follow the transition if valid. Should be called when simulation is paused.- Parameters:
transition
- the transition to follow
-
activateState
void activateState(String stateID)
Activates the state (identified by a potentially non-unique ID) if it exists.- Parameters:
stateID
- the potentially non-unique ID of the state to activate
-
followTransition
void followTransition(String transitionID)
Follow the transition (identified by a potentially non-unique ID) if valid.- Parameters:
transitionID
- the potentially non-unique ID of the transition to follow
-
getPriority
double getPriority()
-
resolve
void resolve()
-
-