Package repast.simphony.engine.schedule
Class ScheduleParameters
java.lang.Object
repast.simphony.engine.schedule.ScheduleParameters
Parameters describing when an action should be scheduled. Use the static
create*
methods to create the appropriate ScheduleParameter
object.- Version:
- $Revision: 1.1 $ $Date: 2005/12/21 22:25:34 $
- Author:
- Nick Collier
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Constant representing end of simulation as the tick at which to execute the actions.static final double
static final double
static final double
Constant representing no duration.static final double
Constant representing random priority. -
Constructor Summary
ModifierConstructorDescriptionprotected
ScheduleParameters
(double start, Frequency frequency, double interval, double priority, PriorityType pType, double duration) -
Method Summary
Modifier and TypeMethodDescriptionstatic ScheduleParameters
createAtEnd
(double priority) Creates a ScheduleParameters appropriate for scheduling an action to occur at the end of the simulation.static ScheduleParameters
createNormalProbabilityOneTime
(double meanStart, double sdStart, double priority) Creates a one time schedule event that is based on a mean start time and standard deviation start time.static ScheduleParameters
createNormalProbabilityRepeating
(double meanStart, double sdStart, double meanInterval, double sdInterval, double priority) Creates a repeating schedule event that is based on a mean start/interval time and standard deviation start/interval time.static ScheduleParameters
createOneTime
(double start) Creates a ScheduleParameters appropriate for scheduling a non-repeating action.static ScheduleParameters
createOneTime
(double start, double priority) Creates a ScheduleParameters appropriate for scheduling a non-repeating action.static ScheduleParameters
createOneTime
(double start, double priority, double duration) Creates a ScheduleParameters appropriate for scheduling a non-repeating action.static ScheduleParameters
createOneTime
(double start, PriorityType type) Creates a ScheduleParameters for scheduling a non-repeating action of the specified PriorityType.static ScheduleParameters
createPoissonProbabilityOneTime
(double mean, double priority) Creates a one time schedule event that is based on a Poisson distribution with the input argument providing the mean to the distribution.static ScheduleParameters
createPoissonProbabilityRepeating
(double mean, double meanRepeating, double priority) Creates a repeating schedule event that is based on a Poisson distribution with the input arguments providing the mean to the distribution and repeating meaning interval.static ScheduleParameters
createRepeating
(double start, double interval) Creates a ScheduleParameters appropriate for scheduling a repeating action.static ScheduleParameters
createRepeating
(double start, double interval, double priority) Creates a ScheduleParameters appropriate for scheduling a repeating action.static ScheduleParameters
createRepeating
(double start, double interval, double priority, double duration) Creates a ScheduleParameters appropriate for scheduling a repeating action.static ScheduleParameters
createRepeating
(double start, double interval, PriorityType priorityType) Creates a ScheduleParameters appropriate for scheduling a repeating action of the first, last, random, or first of last priority type.static ScheduleParameters
createUniformProbabilityOneTime
(double minStart, double maxStart, double priority) Creates a one time schedule event that is based on a uniform distribution with arguments delineating the minimum and maximum of that distribution.static ScheduleParameters
createUniformProbabilityRepeating
(double minStart, double maxStart, double minInterval, double maxInterval, double priority) Creates a repeating schedule event that is based on a uniform distribution with arguments delineating the minimum and maximum of that distribution and repeating interval.boolean
Checks if this ScheduleParamters equals the passed in object.double
Gets the scheduled duration.Gets the scheduled Frequency of execution.double
Gets the interval at which to repeat the execution of an action.double
Gets the priority to schedule an action with.Gets the priority type of this ScheduleParameter.double
getStart()
Gets the scheduled starting time for an action.int
hashCode()
Gets the hash code for this schedule parameters.static boolean
isRandomPriority
(ScheduleParameters params) Gets whether or not the specified parameters are scheduled with a Random priority.toString()
-
Field Details
-
NO_DURATION
public static final double NO_DURATIONConstant representing no duration.- See Also:
-
END
public static final double ENDConstant representing end of simulation as the tick at which to execute the actions.- See Also:
-
RANDOM_PRIORITY
public static final double RANDOM_PRIORITYConstant representing random priority.- See Also:
-
FIRST_PRIORITY
public static final double FIRST_PRIORITY- See Also:
-
LAST_PRIORITY
public static final double LAST_PRIORITY- See Also:
-
-
Constructor Details
-
ScheduleParameters
protected ScheduleParameters(double start, Frequency frequency, double interval, double priority, PriorityType pType, double duration)
-
-
Method Details
-
isRandomPriority
Gets whether or not the specified parameters are scheduled with a Random priority.- Parameters:
params
-- Returns:
- true if the specified parameters are scheduled with a random priority, otherwise false.
-
createRepeating
Creates a ScheduleParameters appropriate for scheduling a repeating action. The action will start at the specified time, and repeat at the specified interval.- Parameters:
start
- the start timeinterval
- the interval at which the execution of the action should repeat- Returns:
- a ScheduleParameters appropriate for scheduling a repeating action
-
createRepeating
public static ScheduleParameters createRepeating(double start, double interval, PriorityType priorityType) Creates a ScheduleParameters appropriate for scheduling a repeating action of the first, last, random, or first of last priority type. The action will repeat at the specified interval. Use ScheduleParameters createRepeating(double start, double interval, double priority) to schedule an action with a numeric priority.- Parameters:
start
- the start timeinterval
- the interval at which the execution of the action should repeatpriorityType
- the priority type of the action- Returns:
- a ScheduleParameters appropriate for scheduling a repeating action
-
createNormalProbabilityOneTime
public static ScheduleParameters createNormalProbabilityOneTime(double meanStart, double sdStart, double priority) Creates a one time schedule event that is based on a mean start time and standard deviation start time.- Parameters:
meanStart
- mean start timesdStart
- standard deviation start timepriority
- the priority of the scheduled task- Returns:
- a schedule parameters object based on a mean(x) and std(x) probability .
-
createUniformProbabilityOneTime
public static ScheduleParameters createUniformProbabilityOneTime(double minStart, double maxStart, double priority) Creates a one time schedule event that is based on a uniform distribution with arguments delineating the minimum and maximum of that distribution.- Parameters:
minStart
- the minimum start time, but not included in the distributionmaxStart
- the maximum start time, but not included in the distributionpriority
- the priority of the scheduled task- Returns:
- a schedule parameters object based on minimum and maximum uniform probability.
-
createPoissonProbabilityOneTime
Creates a one time schedule event that is based on a Poisson distribution with the input argument providing the mean to the distribution.- Parameters:
mean
- the mean of the Poisson distribution- Returns:
- a schedule parameters object based a Poisson probability.
-
createPoissonProbabilityRepeating
public static ScheduleParameters createPoissonProbabilityRepeating(double mean, double meanRepeating, double priority) Creates a repeating schedule event that is based on a Poisson distribution with the input arguments providing the mean to the distribution and repeating meaning interval.- Parameters:
mean
- the mean of the Poisson distributionmeanRepeating
- the mean of the repeating interval- Returns:
- a schedule parameters object based on Poisson probabilities.
-
createNormalProbabilityRepeating
public static ScheduleParameters createNormalProbabilityRepeating(double meanStart, double sdStart, double meanInterval, double sdInterval, double priority) Creates a repeating schedule event that is based on a mean start/interval time and standard deviation start/interval time.- Parameters:
meanStart
- mean start timesdStart
- standard deviation start timemeanInterval
- mean interval timesdInterval
- standard deviation interval timepriority
- the priority of the scheduled task- Returns:
- a schedule parameters object based on mean(x) and std(x) probabilities .
-
createUniformProbabilityRepeating
public static ScheduleParameters createUniformProbabilityRepeating(double minStart, double maxStart, double minInterval, double maxInterval, double priority) Creates a repeating schedule event that is based on a uniform distribution with arguments delineating the minimum and maximum of that distribution and repeating interval.- Parameters:
minStart
- the minimum start time, but not included in the distributionmaxStart
- the maximum start time, but not included in the distributionminInterval
- the minimum interval time, but not included in the distributionmaxInterval
- the maximum interval time, but not included in the distributionpriority
- the priority of the scheduled task- Returns:
- a schedule parameters object based on minimum and maximum uniform probabilities.
-
createRepeating
Creates a ScheduleParameters appropriate for scheduling a repeating action. The action will start at the specified time, repeat at the specified interval, and have the specified priority. Priority refers the order in which an action is executed with respect to other actions scheduled for the same clock tick.- Parameters:
start
- the start timeinterval
- the interval at which the execution of the action should repeatpriority
- the execution priority of an action with respect to other actions scheduled for the same clock tick. A higher number means a higher priority. So an action with a priority of 3 will occur before an action with priority of -2. Special values are: ScheduleParameters.FIRST_PRIORITY which will schedule the action to execute first; ScheduleParameters.LAST_PRIORITY which will scheduled the action to execute last; and ScheduleParameters.RANDOM_PRIORITY which will schedule the action to execute in random order, but not before any "first" actions and not "after" any last actions. Actions whose priority is same are executed in the order they are added to the schedule.- Returns:
- a ScheduleParameters appropriate for scheduling a repeating action
-
createRepeating
public static ScheduleParameters createRepeating(double start, double interval, double priority, double duration) Creates a ScheduleParameters appropriate for scheduling a repeating action. The action will start at the specified time, repeat at the specified interval, and have the specified priority. Priority refers the order in which an action is executed with respect to other actions scheduled for the same clock tick. The action will run in the background for the specified duration.- Parameters:
start
- the start timeinterval
- the interval at which the execution of the action should repeatpriority
- the execution priority of an action with respect to other actions scheduled for the same clock tick. A higher number means a higher priority. So an action with a priority of 3 will occur before an action with priority of -2. Special values are: ScheduleParameters.FIRST_PRIORITY which will schedule the action to execute first; ScheduleParameters.LAST_PRIORITY which will scheduled the action to execute last; and ScheduleParameters.RANDOM_PRIORITY which will schedule the action to execute in random order, but not before any "first" actions and not "after" any last actions. Actions whose priority is same are executed in the order they are added to the schedule.duration
- the number of clock ticks the action can run in the background before it behaves like a normally scheduled action- Returns:
- a ScheduleParameters appropriate for scheduling a repeating action
-
createOneTime
Creates a ScheduleParameters appropriate for scheduling a non-repeating action. The action will start at the specified time.- Parameters:
start
- the start time- Returns:
- a ScheduleParameters appropriate for scheduling a non-repeating action
-
createOneTime
Creates a ScheduleParameters for scheduling a non-repeating action of the specified PriorityType. This method is appropriate for scheduling one time with a priority of first, last, random, and first of last. Use createOneTime(double, double) to schedule a one time action with numeric priority.- Parameters:
start
- the start typetype
- the type of priority the action should have.- Returns:
- the created ScheduleParameters.
-
createOneTime
Creates a ScheduleParameters appropriate for scheduling a non-repeating action. The action will start at the specified time and have the specified priority. Priority refers the order in which an action is executed with respect to other actions scheduled for the same clock tick.- Parameters:
start
- the start timepriority
- the execution priority of an action with respect to other actions scheduled for the same clock tick. A higher number means a higher priority. So an action with a priority of 3 will occur before an action with priority of -2. Special values are: ScheduleParameters.FIRST_PRIORITY which will schedule the action to execute first; ScheduleParameters.LAST_PRIORITY which will scheduled the action to execute last; and ScheduleParameters.RANDOM_PRIORITY which will schedule the action to execute in random order, but not before any "first" actions and not "after" any last actions. Actions whose priority is same are executed in the order they are added to the schedule.- Returns:
- a ScheduleParameters appropriate for scheduling a non-repeating action
-
createOneTime
Creates a ScheduleParameters appropriate for scheduling a non-repeating action. The action will start at the specified time, and have the specified priority. Priority refers the order in which an action is executed with respect to other actions scheduled for the same clock tick. The action will run in the background for the specified duration.- Parameters:
start
- the start timepriority
- the execution priority of an action with respect to other actions scheduled for the same clock tick. A higher number means a higher priority. So an action with a priority of 3 will occur before an action with priority of -2. Special values are: ScheduleParameters.FIRST_PRIORITY which will schedule the action to execute first; ScheduleParameters.LAST_PRIORITY which will scheduled the action to execute last; and ScheduleParameters.RANDOM_PRIORITY which will schedule the action to execute in random order, but not before any "first" actions and not "after" any last actions. Actions whose priority is same are executed in the order they are added to the schedule.duration
- the number of clock ticks the action can run in the background before it behaves like a normally scheduled action- Returns:
- a ScheduleParameters appropriate for scheduling a repeating action
-
createAtEnd
Creates a ScheduleParameters appropriate for scheduling an action to occur at the end of the simulation.- Parameters:
priority
- the execution priority of an action with respect to other actions scheduled for the same clock tick. A higher number means a higher priority. So an action with a priority of 3 will occur before an action with priority of -2. Special values are: ScheduleParameters.FIRST_PRIORITY which will schedule the action to execute first; ScheduleParameters.LAST_PRIORITY which will scheduled the action to execute last; and ScheduleParameters.RANDOM_PRIORITY which will schedule the action to execute in random order, but not before any "first" actions and not "after" any last actions. Actions whose priority is same are executed in the order they are added to the schedule.- Returns:
- a ScheduleParameters appropriate for scheduling an action to occur at the end of the simulation.
-
getStart
public double getStart()Gets the scheduled starting time for an action.- Returns:
- the scheduled starting time.
-
getPriorityType
Gets the priority type of this ScheduleParameter.- Returns:
- the priority type of this ScheduleParameter.
-
getPriority
public double getPriority()Gets the priority to schedule an action with.- Returns:
- the priority to schedule an action with.
-
getInterval
public double getInterval()Gets the interval at which to repeat the execution of an action. A non-repeating action will return 0.- Returns:
- the interval at which to repeat the execution of an action. A non-repeating action will return 0.
-
getFrequency
Gets the scheduled Frequency of execution.- Returns:
- the scheduled Frequency of execution.
-
getDuration
public double getDuration()Gets the scheduled duration.- Returns:
- the scheduled duration.
-
hashCode
public int hashCode()Gets the hash code for this schedule parameters. -
equals
Checks if this ScheduleParamters equals the passed in object. The passed object is equal to this one if all its parameters (start, end, etc.) are equal to this one. -
toString
-