Class DefaultStateChart<T>

java.lang.Object
repast.simphony.statecharts.DefaultStateChart<T>
All Implemented Interfaces:
StateChart<T>

public class DefaultStateChart<T> extends Object implements StateChart<T>
  • Field Details

  • Constructor Details

    • DefaultStateChart

      protected DefaultStateChart(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.
      Parameters:
      agent -
      contextRequired -
  • Method Details

    • getTransitionResolutionStrategy

      protected TransitionResolutionStrategy getTransitionResolutionStrategy()
    • setTransitionResolutionStrategy

      protected void setTransitionResolutionStrategy(TransitionResolutionStrategy transitionResolutionStrategy)
    • setStateUuidMap

      protected void setStateUuidMap(Map<AbstractState<T>,String> stateUuidMap)
    • putStateUuid

      protected void putStateUuid(AbstractState<T> state, String uuid)
    • setTransitionUuidMap

      protected void setTransitionUuidMap(Map<Transition<T>,String> transitionUuidMap)
    • putTransitionUuid

      protected void putTransitionUuid(Transition<T> transition, String uuid)
    • registerEntryState

      protected void registerEntryState(AbstractState<T> state)
    • begin

      public void begin(StateChartSimIntegrator integrator)
      Description copied from interface: StateChart
      Begin state chart.
      Specified by:
      begin in interface StateChart<T>
    • stop

      public void stop()
      Stops this statechart.
      Specified by:
      stop in interface StateChart<T>
    • addState

      protected void addState(AbstractState<T> state)
    • addRegularTransition

      protected void addRegularTransition(Transition<T> transition)
    • addSelfTransition

      protected void addSelfTransition(SelfTransition<T> transition)
    • getCurrentSimpleState

      public SimpleState<T> getCurrentSimpleState()
      Description copied from interface: StateChart
      Retrieve current state.
      Specified by:
      getCurrentSimpleState in interface StateChart<T>
      Returns:
    • resolve

      public void resolve()
      Specified by:
      resolve in interface StateChart<T>
    • scheduleResolveTime

      protected void scheduleResolveTime(double nextTime)
    • removeResolveTime

      protected void removeResolveTime(double nextTime)
    • getQueue

      protected Queue<Object> getQueue()
    • receiveMessage

      public void receiveMessage(Object message)
      Description copied from interface: StateChart
      Receive a message into the statechart queue.
      Specified by:
      receiveMessage in interface StateChart<T>
    • getPriority

      public double getPriority()
      Specified by:
      getPriority in interface StateChart<T>
    • setPriority

      protected void setPriority(double priority)
    • getAgent

      public T getAgent()
      Description copied from interface: StateChart
      Gets the agent associated with this StateChart.
      Specified by:
      getAgent in interface StateChart<T>
      Returns:
      the agent associated with this StateChart.
    • getParams

      protected Parameters getParams()
    • withinState

      public boolean withinState(String id)
      Specified by:
      withinState in interface StateChart<T>
    • getCurrentStates

      public List<AbstractState<T>> getCurrentStates()
      Specified by:
      getCurrentStates in interface StateChart<T>
    • getUuidForState

      public String getUuidForState(AbstractState<T> state)
      Specified by:
      getUuidForState in interface StateChart<T>
    • getStateForUuid

      public AbstractState<T> getStateForUuid(String uuid)
      Description copied from interface: StateChart
      Returns the state associated with the uuid or null if not found.
      Specified by:
      getStateForUuid in interface StateChart<T>
      Returns:
    • getTransitionForUuid

      public Transition<T> getTransitionForUuid(String uuid)
      Description copied from interface: StateChart
      Returns the transition associated with the uuid or null if not found.
      Specified by:
      getTransitionForUuid in interface StateChart<T>
      Returns:
    • registerStateChartListener

      public void registerStateChartListener(StateChartListener scl)
      Specified by:
      registerStateChartListener in interface StateChart<T>
    • removeStateChartListener

      public void removeStateChartListener(StateChartListener scl)
      Specified by:
      removeStateChartListener in interface StateChart<T>
    • activateState

      public void activateState(AbstractState<T> state)
      Description copied from interface: StateChart
      Activates the state if it exists. Should be called when simulation is paused.
      Specified by:
      activateState in interface StateChart<T>
      Parameters:
      state - the state to activate
    • activateState

      public void activateState(String stateID)
      Description copied from interface: StateChart
      Activates the state (identified by a potentially non-unique ID) if it exists.
      Specified by:
      activateState in interface StateChart<T>
      Parameters:
      stateID - the potentially non-unique ID of the state to activate
    • followTransition

      public void followTransition(String transitionID)
      Description copied from interface: StateChart
      Follow the transition (identified by a potentially non-unique ID) if valid.
      Specified by:
      followTransition in interface StateChart<T>
      Parameters:
      transitionID - the potentially non-unique ID of the transition to follow
    • followTransition

      public void followTransition(Transition<T> transition)
      Description copied from interface: StateChart
      Follow the transition if valid. Should be called when simulation is paused.
      Specified by:
      followTransition in interface StateChart<T>
      Parameters:
      transition - the transition to follow