Schedule

class Schedule(parent: ModelElement, startTime: Double = 0.0, length: Double = Double.POSITIVE_INFINITY, autoStartOption: Boolean = true, repeatable: Boolean = true, startPriority: Int = KSLEvent.DEFAULT_PRIORITY - 5, itemPriority: Int = KSLEvent.DEFAULT_PRIORITY - 4, name: String? = null) : ModelElement, ScheduleCIfc

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

Link copied to clipboard
constructor(parent: ModelElement, scheduleData: ScheduleData, name: String? = null)
constructor(parent: ModelElement, startTime: Double = 0.0, length: Double = Double.POSITIVE_INFINITY, autoStartOption: Boolean = true, repeatable: Boolean = true, startPriority: Int = KSLEvent.DEFAULT_PRIORITY - 5, itemPriority: Int = KSLEvent.DEFAULT_PRIORITY - 4, name: String? = null)

Types

Link copied to clipboard
open inner class ScheduleItem(val name: String = "Item:", val startTime: Double, val duration: Double, val priority: Int = itemStartEventPriority, val message: String? = null, val datum: Double? = null) : Comparable<Schedule.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).

Properties

Link copied to clipboard

A flag to control if the model element reacts to after experiment actions.

Link copied to clipboard

A flag to control whether the model element reacts to after replication actions.

Link copied to clipboard

A flag to control if the model element reacts to before experiment actions.

Link copied to clipboard

A flag to control if the model element reacts to before replication actions.

Link copied to clipboard

Indicates the current status of the model element for observers of ModelElement.Status

Link copied to clipboard

The time that the schedule started for its current cycle

Link copied to clipboard
open override val id: Int
Link copied to clipboard

A flag to control if the model element reacts to initialization actions

Link copied to clipboard
open override var initialStartTime: Double

The time from the beginning of the replication to the time that the schedule is to start

Link copied to clipboard
open override var isAutoStartFlag: Boolean

Indicates whether the schedule should be started automatically upon initialization, default is true

Link copied to clipboard
open override val isEmpty: Boolean

Checks if there are no items on the schedule

Link copied to clipboard
Link copied to clipboard
open override var isScheduleRepeatable: Boolean

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

Link copied to clipboard
open override var itemStartEventPriority: Int

the priority associated with the item's start event

Link copied to clipboard
open override var label: String?
Link copied to clipboard

the left traversal count for pre-order traversal of the model element tree

Link copied to clipboard

the model that contains this element

Link copied to clipboard

Returns a string representation of the model element and its child model elements. Useful for realizing the model element hierarchy.

Link copied to clipboard

A flag to control if the model element participates in monte carlo actions.

Link copied to clipboard
override val name: String
Link copied to clipboard

Gets the number of model elements contained by the model element.

Link copied to clipboard
open override val parentName: String?
Link copied to clipboard

Indicates the previous status of the model element for observers of ModelElement.Status This allows the transition to be noted by observers

Link copied to clipboard

A flag to control if the model element reacts to end replication actions.

Link copied to clipboard

the right traversal count for pre-order traversal of the model element tree

Link copied to clipboard

The data associated with the schedule

Link copied to clipboard

The schedule item data as a list

Link copied to clipboard
open override var scheduleLength: Double

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.

Link copied to clipboard

The spatial model associated with this model element. By default, each model element uses its parent model element's spatial model unless changed via this property. This changes the spatial model for this model element and no others.

Link copied to clipboard
open override var startEventPriority: Int

the priority associated with the schedule's start event

Link copied to clipboard
Link copied to clipboard
override val time: Double
Link copied to clipboard

The time interval between TimedUpdate events. The default is zero, indicating no timed update

Link copied to clipboard

Specifies whether this model element participates in time update event specified by its parent

Link copied to clipboard

Specifies the havingPriority of this model element's timed update event.

Link copied to clipboard

Indicates whether the warm-up action occurred sometime during the simulation for this model element. False indicates that the warm-up action has not occurred

Link copied to clipboard

Specifies if this model element is warmed up when the warmup action occurs for its parent. The warm-up flag indicates whether this model element will be warmed up when its parent warm-up event/action occurs. The default value for all model elements is true. A value of true implies that the model element allows its parent's warm up event to call the warm-up action. A value of false implies that the model element does not allow its parent's warm up event to call the warm-up action. False does not necessarily mean that the model element will not be warmed up. It may, through the use of the lengthOfWarmUp property, have its own warm-up event and action.

Link copied to clipboard

Specifies the priority of this model element's warm up event.

Functions

Link copied to clipboard
open override fun addItem(scheduleItemData: ScheduleItemData): Schedule.ScheduleItem

Adds the item to the schedule

fun addItem(startTime: Double, duration: Double, name: String = "Item:", priority: Int = itemStartEventPriority, message: String? = null, datum: Double? = null): Schedule.ScheduleItem

Adds an item to the schedule

Link copied to clipboard
open override fun addItems(items: List<ScheduleItemData>)

Adds all the items to the schedule.

Link copied to clipboard

The same listener cannot be added more than once. Listeners are notified of schedule changes in the sequence by which they were added.

Link copied to clipboard
Link copied to clipboard
fun <T> BernoulliPicker(successProbability: Double, successOption: T, failureOption: T, streamNum: Int = 0): BernoulliPicker<T>
Link copied to clipboard
fun BernoulliRV(probOfSuccess: Double, streamNum: Int = 0, name: String? = null): BernoulliRV
Link copied to clipboard
fun BetaRV(alpha1: Double, alpha2: Double, streamNum: Int = 0, name: String? = null): BetaRV
Link copied to clipboard
fun BinomialRV(pSuccess: Double, numTrials: Int, streamNum: Int = 0, name: String? = null): BinomialRV
Link copied to clipboard

If scheduled to start, this cancels the start of the schedule.

Link copied to clipboard

Cancels the timed update event for this model element.

Link copied to clipboard

Cancels the warm-up event for this model element.

Link copied to clipboard

Checks if this model element or any model element directly above this model element in the hierarchy of model elements all the way until the top Model participates in the warm-up action.

Link copied to clipboard
open override fun clearSchedule()

Removes all schedule items from the schedule

Link copied to clipboard
open override fun configureFromJson(json: String): ScheduleData

Uses the supplied JSON string to configure the schedule via ScheduleData

Link copied to clipboard
fun ConstantRV(value: Double, name: String? = null): ConstantRV
Link copied to clipboard
open operator override fun contains(listener: ScheduleChangeListenerIfc): Boolean
Link copied to clipboard
open override fun countScheduleChangeListeners(): Int
Link copied to clipboard
open override fun currentSettings(): ScheduleData

Returns the current settings in the form of the data type that can be serialized.

Link copied to clipboard
fun day(): Double

Returns the value of a 1-day time interval in terms of the base time unit

Link copied to clipboard
Link copied to clipboard
open override fun deleteScheduleChangeListeners()

Deletes all listeners

Link copied to clipboard
fun <T> DEmpiricalList(elements: List<T>, theCDF: DoubleArray, streamNum: Int = 0): DEmpiricalList<T>
Link copied to clipboard
fun DEmpiricalRV(values: DoubleArray, cdf: DoubleArray, streamNum: Int = 0, name: String? = null): DEmpiricalRV
Link copied to clipboard
fun DPopulation(elements: DoubleArray, streamNum: Int = 0): DPopulation
Link copied to clipboard
fun <T> DUniformList(elements: MutableList<T> = mutableListOf(), streamNum: Int = 0): DUniformList<T>
Link copied to clipboard
fun DUniformRV(range: IntRange, streamNum: Int = 0, name: String? = null): DUniformRV
fun DUniformRV(min: Int, max: Int, streamNum: Int = 0, name: String? = null): DUniformRV
Link copied to clipboard
fun EmpiricalRV(data: DoubleArray, streamNum: Int = 0, name: String? = null): EmpiricalRV
fun EmpiricalRV(interval: Interval, numPoints: Int, streamNum: Int = 0, name: String? = null): EmpiricalRV
fun EmpiricalRV(lowerLimit: Double, numPoints: Int, width: Double, streamNum: Int = 0, name: String? = null): EmpiricalRV
Link copied to clipboard
fun ExponentialRV(mean: Double, streamNum: Int = 0, name: String? = null): ExponentialRV
Link copied to clipboard

Find the first parent that has its own warm-up event this guarantees that all elements below the found model element do not have their own warm-up event. A model element that has its own warm-up event also opts out of the warm-up action. If the returned parent is the Model, then all are controlled by the model (unless they opt out). Elements can opt out and not have their own warm-up event. Thus, they have no warm-up at all.

Link copied to clipboard
fun GammaRV(shape: Double, scale: Double, streamNum: Int = 0, name: String? = null): GammaRV
Link copied to clipboard
fun GeneralizedBetaRV(alpha: Double, beta: Double, min: Double, max: Double, streamNum: Int = 0, name: String? = null): GeneralizedBetaRV
Link copied to clipboard
fun GeometricRV(probOfSuccess: Double, streamNum: Int = 0, name: String? = null): GeometricRV
Link copied to clipboard

Fills up the supplied StringBuilder carrying a string representation of the model element and its child model elements Useful for realizing the model element hierarchy.

Link copied to clipboard

This method returns the planned time for the warm-up for this model element.

Link copied to clipboard
fun hour(): Double

Returns the value of a 1-hour time interval in terms of the base time unit

Link copied to clipboard
fun Hyper2ExponentialRV(mixingProb: Double, mean1: Double, mean2: Double, streamNum: Int = 0, name: String? = null): Hyper2ExponentialRV
Link copied to clipboard

Fills a StringBuilder carrying the model element names in the order that they will be initialized

Link copied to clipboard

Checks if a warm-up event is scheduled for any model element directly above this model element in the hierarchy of model elements all the way until the top Model.

Link copied to clipboard

Checks if current status is the supplied status

Link copied to clipboard

Checks if a timed update event has been scheduled for this model element

Link copied to clipboard

Checks if a warm-up event has been scheduled for this model element

Link copied to clipboard
fun JohnsonBRV(alpha: Double, beta: Double, min: Double, max: Double, streamNum: Int = 0, name: String? = null): JohnsonBRV
Link copied to clipboard
fun LaplaceRV(location: Double, scale: Double, streamNum: Int = 0, name: String? = null): LaplaceRV
Link copied to clipboard
fun LogisticRV(location: Double, scale: Double, streamNum: Int = 0, name: String? = null): LogisticRV
Link copied to clipboard
fun LogLogisticRV(shape: Double, scale: Double, streamNum: Int = 0, name: String? = null): LogLogisticRV
Link copied to clipboard
fun LognormalRV(mean: Double, variance: Double, streamNum: Int = 0, name: String? = null): LognormalRV
Link copied to clipboard

Returns the value of a 1-millisecond time interval in terms of the base time unit

Link copied to clipboard
fun minute(): Double

Returns the value of a 1-minute time interval in terms of the base time unit. For example, if the time unit is set to hours, then minute() should return 0.0166 (TIME_UNIT_MINUTE/TIME_UNIT_HOUR)

Link copied to clipboard
fun MixtureRV(list: List<RVariableIfc>, cdf: DoubleArray, streamNum: Int = 0, name: String? = null): MixtureRV
Link copied to clipboard
fun NormalRV(mean: Double, variance: Double, streamNum: Int = 0, name: String? = null): NormalRV
Link copied to clipboard
fun PearsonType5RV(shape: Double, scale: Double, streamNum: Int = 0, name: String? = null): PearsonType5RV
Link copied to clipboard
fun PearsonType6RV(alpha1: Double, alpha2: Double, beta: Double, streamNum: Int = 0, name: String? = null): PearsonType6RV
Link copied to clipboard
fun PoissonRV(mean: Double, streamNum: Int = 0, name: String? = null): PoissonRV
Link copied to clipboard
fun PWCEmpiricalRV(histogram: HistogramIfc, streamNum: Int = 0, name: String? = null): PWCEmpiricalRV
fun PWCEmpiricalRV(breakPoints: DoubleArray, proportions: DoubleArray = DoubleArray(breakPoints.size - 1) { 1.0 / (breakPoints.size - 1) }, streamNum: Int = 0, name: String? = null): PWCEmpiricalRV
Link copied to clipboard
open override fun removeItem(item: Schedule.ScheduleItem?)

Removes the item from the schedule. If the item is null or not on this schedule nothing happens.

Link copied to clipboard

Schedules the start of the schedule for the start time of the schedule if it has not already been started

Link copied to clipboard
fun second(): Double

Returns the value of a 1-second time interval in terms of the base time unit

Link copied to clipboard

Sets the after experiment option of all model elements (children) contained by this model element.

Sets the after replication flag of all model elements (children) contained by this model element.

Sets the before experiment option of all model elements (children) contained by this model element.

Sets the before replication flag of all model elements (children) contained by this model element.

Link copied to clipboard

Sets the initialization option of all model elements (children) contained by this model element.

Link copied to clipboard

Sets the monte carlo option flag of all model elements (children) contained by this model element.

Sets the end replication option flag of all model elements (children) contained by this model element. Determines whether the replicationEnded() method will be called

Link copied to clipboard

Sets the timed update option flag of all model elements (children) contained by this model element.

Link copied to clipboard
open override fun settingsToJson(): String

Converts the configuration settings to JSON

Link copied to clipboard

Sets the warm-up option flag of all model elements (children) contained by this model element.

Link copied to clipboard
fun ShiftedGeometricRV(probOfSuccess: Double, streamNum: Int = 0, name: String? = null): ShiftedGeometricRV
Link copied to clipboard
fun ShiftedRV(shift: Double, rv: RVariableIfc, streamNum: Int = 0, name: String? = null): ShiftedRV
Link copied to clipboard
open override fun time(): Double
Link copied to clipboard
open override fun toString(): String

Includes the model name, the id, the model element name, the parent name, and parent id

Link copied to clipboard
fun TriangularRV(min: Double, mode: Double, max: Double, streamNum: Int = 0, name: String? = null): TriangularRV
Link copied to clipboard
fun TruncatedNormalRV(mean: Double, variance: Double, interval: Interval, streamNum: Int = 0, name: String? = null): TruncatedNormalRV
Link copied to clipboard
fun TruncatedRV(distribution: InvertibleCDFIfc, cdfLL: Double, cdfUL: Double, lowerLimit: Double, upperLimit: Double, streamNum: Int = 0, name: String? = null): TruncatedRV
Link copied to clipboard
fun UniformRV(interval: Interval, streamNum: Int = 0, name: String? = null): UniformRV
fun UniformRV(min: Double, max: Double, streamNum: Int = 0, name: String? = null): UniformRV
Link copied to clipboard
fun week(): Double

Returns the value of a 1-week time interval in terms of the base time unit

Link copied to clipboard
fun WeibullRV(shape: Double, scale: Double, streamNum: Int = 0, name: String? = null): WeibullRV