EventGenerator

open class EventGenerator @JvmOverloads constructor(parent: ModelElement, generateAction: GeneratorActionIfc?, timeUntilFirstRV: RVariableIfc, timeBtwEventsRV: RVariableIfc, maxNumberOfEvents: Long = Long.MAX_VALUE, timeOfTheLastEvent: Double = Double.POSITIVE_INFINITY, name: String? = null) : ModelElement, EventGeneratorIfc, EventGeneratorInitializationCIfc, EventGeneratorRVIfc, EventGeneratorRVCIfc(source)

Constructors

Link copied to clipboard
constructor(parent: ModelElement, generateAction: GeneratorActionIfc?, arrivalsRV: RVariableIfc, maxNumberOfEvents: Long = Long.MAX_VALUE, timeOfTheLastEvent: Double = Double.POSITIVE_INFINITY, name: String? = null)

This class allows for the periodic generation of events similar to that achieved by "Create" modules in simulation languages. This class works in conjunction with the GeneratorActionIfc, which is used to listen and react to the events that are generated by this class.

constructor(parent: ModelElement, generateAction: GeneratorActionIfc?, timeUntilFirstRV: RVariableIfc, timeBtwEventsRV: RVariableIfc, maxNumberOfEvents: Long = Long.MAX_VALUE, timeOfTheLastEvent: Double = Double.POSITIVE_INFINITY, name: String? = null)

Types

Link copied to clipboard
interface ActionStepIfc
Link copied to clipboard
interface BuildStepIfc
Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard

Can be used to supply logic to invoke when the generator's ending time is finite and the generator is turned off.

Link copied to clipboard
open override var endingTime: Double

The time to stop generating for the current replication

Link copied to clipboard
open override var eventCount: Long

The number of events currently generated during the replication

Link copied to clipboard

Determines the priority of the event generator's events The default is DEFAULT_PRIORITY - 1 A lower number implies higher priority.

Link copied to clipboard

The action for the events for generation

Link copied to clipboard
@set:KSLControl(controlType = ControlType.DOUBLE, name = "initialEndingTime", lowerBound = 0.0)
open override var initialEndingTime: Double

Used to set the ending time when the generator is initialized at the start of each replication.

Link copied to clipboard
@set:KSLControl(controlType = ControlType.LONG, name = "initialMaximumNumberOfEvents", lowerBound = 1.0)
open override var initialMaximumNumberOfEvents: Long

Controls the maximum number of events to be used to initialize each replication. The time between events cannot evaluate to a constant value of 0.0 if the maximum number of events is infinite (Long.MAX_VALUE). Uses the current value for initial time between events

Link copied to clipboard

Sets the time between events and the maximum number of events to be used to initialize each replication. The time between events cannot evaluate to a constant value of 0.0. The maximum number of events is kept at its current value, which by default is Long.Max_Value. Note that setting the initial time between events does not affect the random variable governing the time of the first event.

Link copied to clipboard
open override var isDone: Boolean

Whether the generator is done generating

Link copied to clipboard
open override val isEventPending: Boolean

true if an event is scheduled to occur for the generator

Link copied to clipboard
open override var isStarted: Boolean

indicates whether the generator has been started (turned on)

Link copied to clipboard
open override var isSuspended: Boolean

Whether the generator has been suspended

Link copied to clipboard
open override var maximumNumberOfEvents: Long

A long representing the maximum number of events for the generator. Sets the maximum number of events for the generator. Must not be infinite (Long.MAX_VALUE) if the current time between events is 0.0. This only controls the current replication.

Link copied to clipboard
@set:KSLControl(controlType = ControlType.BOOLEAN, name = "startOnInitializeOption")
open override var startOnInitializeOption: Boolean

This flag controls whether the generator starts automatically when initialized at the beginning of a replication. By default, this option is true. If it is changed then it remains at the set value until changed again.

Link copied to clipboard
open override var timeBetweenEvents: RVariableIfc

The time between events for the current replication

Link copied to clipboard

Controls the random variable representing the time until the first event that is used at the beginning of each replication to generate the time until the first event. This change becomes effective at the beginning of the next replication to execute

Functions

Link copied to clipboard
open override fun resume()

Resume the generation of events according to the time between event distribution.

Link copied to clipboard
open override fun setInitialEventTimeProcesses(eventTimeProcess: RVariableIfc)

Often the time of the first event and the time between events is the same distribution. This property causes both initialTimeUntilFirstEvent and initialTimeBtwEvents to be set to the same random variable.

open override fun setInitialTimeBetweenEventsAndMaxNumEvents(initialTimeBtwEvents: RVariableIfc, initialMaxNumEvents: Long)

Sets the time between events and the maximum number of events to be used to initialize each replication. These parameters are dependent. The time between events cannot evaluate to a constant value of 0.0 if the maximum number of events is infinite (Long.MAX_VALUE)

Link copied to clipboard
open override fun setTimeBetweenEvents(timeBtwEvents: RVariableIfc, maxNumEvents: Long)

Sets the time between events and the maximum number of events for the generator. These two parameters are dependent. The time between events cannot always evaluate to 0.0 if the maximum number of events is infinite (Long.MAX_VALUE). This method only changes these parameters for the current replication. The changes take effect when the next event is generated. If current number of events that have been generated is greater than or equal to the supplied maximum number of events, the generator will be turned off.

Link copied to clipboard
open override fun suspend()

Suspends the generation of events and cancels the next scheduled event from the generator

Link copied to clipboard
open override fun turnOffGenerator()

This method turns the generator off, the next scheduled generation event will NOT occur, i.e. this method will also cancel a previously scheduled generation event if one exists. No future events will be scheduled after turning off the generator

Link copied to clipboard
open override fun turnOnGenerator(t: Double)

If the generator was not started upon initialization at the beginning of a replication, then this method can be used to start the generator