Package repast.simphony.engine.schedule
Interface ISchedulableAction
- All Superinterfaces:
IAction
- All Known Implementing Classes:
AbstractAction
,DefaultAction
,ThreadedAction
Interface for actions that can be scheduled and executed by a Schedule.
- Author:
- Nick Collier
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addForExecution
(ScheduleGroup group) Add this ScheduableAction to the specified group for execution.double
Gets the next time this ScheduledAction is to execute.long
Gets an index indicating where this IAction was added to a schedule w/r to all other actions added to a schedule.double
Gets the priority of this action.Gets the PriorityType of this action.boolean
This is used by the schedule to determine if the action is a model related action or a back-end action.void
reschedule
(ActionQueue queue) Reschedule this ScheduableAction using the specified queue.
-
Method Details
-
getNextTime
double getNextTime()Gets the next time this ScheduledAction is to execute.- Returns:
- the next time this ScheduledAction is to execute.
-
reschedule
Reschedule this ScheduableAction using the specified queue. If an action is non-repeating then this method would typically do nothing.- Parameters:
queue
-
-
addForExecution
Add this ScheduableAction to the specified group for execution.- Parameters:
group
- the group to add the ISchedulableAction to.
-
getPriority
double getPriority()Gets the priority of this action. The priority refers to this ISchedulableAction's place in the order of execution with respect to all the other actions that will execute at the same clock tick. The range is from Double.NEGATIVE_INFINITY (execute first) to Double.POSITIVE_INFINITY (execute last). The default is ScheduleParameters.RANDOM_PRIORITY which means the priority will be randomly assigned from a uniform distribution.- Returns:
- the priority of this ScheduableAction.
-
getPriorityType
PriorityType getPriorityType()Gets the PriorityType of this action.- Returns:
- the PriorityType of this action.
-
getOrderIndex
long getOrderIndex()Gets an index indicating where this IAction was added to a schedule w/r to all other actions added to a schedule.- Returns:
- an index indicating where this IAction was added to a schedule w/r to all other actions added to a schedule.
-
isNonModelAction
boolean isNonModelAction()This is used by the schedule to determine if the action is a model related action or a back-end action. NormalIAction
s useNonModelAction
to specify this, butISchedulableAction
s should use this method.- Returns:
- if this is a back-end type action or not
-