NHPPEventGenerator

open class NHPPEventGenerator(parent: ModelElement, var generatorAction: GeneratorActionIfc?, nhpp: NHPPTimeBtwEventRV, maxNumberOfEvents: Long = Long.MAX_VALUE, timeOfTheLastEvent: Double = Double.POSITIVE_INFINITY, name: String? = null) : ModelElement, EventGeneratorIfc, EventGeneratorInitializationCIfc(source)

Parameters

parent

the parent

generatorAction

the listener for generation

nhpp

the non-homogeneous Poisson process

maxNumberOfEvents

A long that supplies the maximum number of events to generate. Each time an event is to be scheduled the maximum number of events is checked. If the maximum has been reached, then the generator is turned off. The default is Long.MAX_VALUE. This parameter cannot be Long.MAX_VALUE when the time until next always returns a value of 0.0

timeOfTheLastEvent

A double that supplies a time to stop generating events. When the generator is created, this variable is used to set the ending time of the generator. Each time an event is to be scheduled the ending time is checked. If the time of the next event is past this time, then the generator is turned off and the event won't be scheduled. The default is Double.POSITIVE_INFINITY.

name

the name of the generator

Inheritors

Constructors

Link copied to clipboard
constructor(parent: ModelElement, generatorAction: GeneratorActionIfc?, rateFunction: InvertibleCumulativeRateFunctionIfc, streamNum: Int = 0, lastRate: Double = Double.NaN, maxNumberOfEvents: Long = Long.MAX_VALUE, timeOfTheLastEvent: Double = Double.POSITIVE_INFINITY, name: String? = null)
constructor(parent: ModelElement, generatorAction: GeneratorActionIfc?, nhpp: NHPPTimeBtwEventRV, maxNumberOfEvents: Long = Long.MAX_VALUE, timeOfTheLastEvent: Double = Double.POSITIVE_INFINITY, name: String? = null)

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
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

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
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

Allows the changing of the rate function only if the model is not running.

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.

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 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