Package repast.simphony.statecharts
Enum StateChartScheduler
- java.lang.Object
-
- java.lang.Enum<StateChartScheduler>
-
- repast.simphony.statecharts.StateChartScheduler
-
- All Implemented Interfaces:
Serializable
,Comparable<StateChartScheduler>
public enum StateChartScheduler extends Enum<StateChartScheduler>
This is singleton responsible for managing the scheduling of statechart begin and resolve actions. Both of these actions need to be managed because they are added and removed based on statechart or simulation logic.- Author:
- jozik
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Field Summary
Fields Modifier and Type Field Description protected Map<Double,repast.simphony.statecharts.StateChartScheduler.BeginActionsMapValue>
beginActions
protected DefaultIntegrator
integrator
protected Map<Double,repast.simphony.statecharts.StateChartScheduler.ResolveActionsMapValue>
resolveActions
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
beginLater(double later, StateChart<?> sc)
Convenience method to schedule a statechart for activation at a later time.static void
beginNow(StateChart<?> sc)
Convenience method to schedule a statechart for immediate activation.void
beginNowWithoutScheduling(StateChart<?> sc)
Method to begin the statechart now without using the schedule.protected void
clearOldBeginActions()
protected void
clearOldResolveActions()
void
initialize()
Initializes the scheduler.protected void
removeResolveTime(double nextTime, StateChart<?> sc)
void
scheduleBeginTime(double nextTime, StateChart<?> sc)
Called by generated statechart code to schedule the begin time for a statechart.protected void
scheduleResolveTime(double nextTime, StateChart<?> sc)
static StateChartScheduler
valueOf(String name)
Returns the enum constant of this type with the specified name.static StateChartScheduler[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final StateChartScheduler INSTANCE
-
-
Field Detail
-
resolveActions
protected Map<Double,repast.simphony.statecharts.StateChartScheduler.ResolveActionsMapValue> resolveActions
-
beginActions
protected Map<Double,repast.simphony.statecharts.StateChartScheduler.BeginActionsMapValue> beginActions
-
integrator
protected DefaultIntegrator integrator
-
-
Method Detail
-
values
public static StateChartScheduler[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (StateChartScheduler c : StateChartScheduler.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StateChartScheduler valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
initialize
public void initialize()
Initializes the scheduler. This is automatically called by a simulation end action or for simulations using other forms of initialization during a simulation run, from initialization appropriate places if (e.g., ReLogo setup methods, via clearAll())
-
clearOldResolveActions
protected void clearOldResolveActions()
-
clearOldBeginActions
protected void clearOldBeginActions()
-
scheduleResolveTime
protected void scheduleResolveTime(double nextTime, StateChart<?> sc)
-
beginNow
public static void beginNow(StateChart<?> sc)
Convenience method to schedule a statechart for immediate activation.- Parameters:
sc
- statechart to be activated
-
beginLater
public static void beginLater(double later, StateChart<?> sc)
Convenience method to schedule a statechart for activation at a later time.- Parameters:
later
- ticks from current time when statechart should be activatedsc
- statechart to be activated
-
beginNowWithoutScheduling
public void beginNowWithoutScheduling(StateChart<?> sc)
Method to begin the statechart now without using the schedule. This is necessary for calling when the simulation is paused.- Parameters:
sc
-
-
scheduleBeginTime
public void scheduleBeginTime(double nextTime, StateChart<?> sc)
Called by generated statechart code to schedule the begin time for a statechart.- Parameters:
nextTime
-sc
-
-
removeResolveTime
protected void removeResolveTime(double nextTime, StateChart<?> sc)
-
-