Schedule
A Schedule represents a known set of events that can occur according to a pattern. A schedule contains one or more instances of ScheduleItem. A ScheduleItem represents an item on a Schedule. It has a start time, relative to the start of the Schedule and a duration. If more than one schedule item needs to start at the same time, then a priority can be provided to determine the ordering (i.e. the smallest priority goes first). ScheduleItems are not scheduled to occur until the Schedule actually starts.
A Schedule has an auto start flag, which controls whether the schedule should start automatically upon initialization (at the start of the simulation). The default is to start automatically.
A Schedule has an initial start time, which represents the amount of time after the beginning of the simulation that the schedule is to start. The default start time is zero (at the beginning of the simulation).
A Schedule as a length (or duration) that represents the total time associated with the schedule. After this time has elapsed the entire schedule can repeat if the repeat option is on. The default length of a schedule is infinite. The total or maximum duration of scheduled items cannot exceed the schedule duration if it is finite.
A Schedule has a repeat flag that controls whether it will repeat after its duration has elapsed. The default is to repeat the schedule and is only relevant if the schedule duration (length) is finite.
A Schedule has a cycle start time that represents when the schedule started its current cycle. Again, this is only relevant if the repeat flag is true and the schedule duration is finite. If there is only one cycle, it is the time that the schedule started.
To make a Schedule useful, instances of the ScheduleChangeListenerIfc interface should be added to listen for changes in the schedule. Instances of ScheduleChangeListenerIfc are notified in the order in which they are added to the schedule. Instances of ScheduleChangeListenerIfc are notified when the schedule starts, when it ends, and when any ScheduleItem starts and ends. It is up to the instance of ScheduleChangeListenerIfc to react to the schedule changes that it needs to react to and ignore those that it does not care about.
Author
rossetti
Constructors
Types
A ScheduleItem represents an item on a Schedule. It has a start time, relative to the start of the Schedule and a duration. If more than one schedule item needs to start at the same time, then a priority can be provided to determine the ordering (i.e. the smallest priority goes first).
Properties
The time that the schedule started for its current cycle
The time from the beginning of the replication to the time that the schedule is to start
Indicates whether the schedule should be started automatically upon initialization, default is true
The schedule repeat flag controls whether the entire schedule will repeat after its entire duration has elapsed. The default is to repeat the schedule. The use of this flag only makes sense if a finite schedule length is specified
the priority associated with the item's start event
The schedule item data as a list
Represents the total length of time of the schedule. The total of the durations added to the schedule cannot exceed this amount. After this time has elapsed the entire schedule can repeat if the schedule repeat flag is true. The default is infinite.
the priority associated with the schedule's start event
Functions
Adds all the items to the schedule.
The same listener cannot be added more than once. Listeners are notified of schedule changes in the sequence by which they were added.
If scheduled to start, this cancels the start of the schedule.
Removes all schedule items from the schedule
Deletes all listeners
Removes the item from the schedule. If the item is null or not on this schedule nothing happens.
Schedules the start of the schedule for the start time of the schedule if it has not already been started