KSLEvent

class KSLEvent<out T> : Comparable<KSLEvent<*>>

This class represents a simulated event. It allows for the simulation of durations of simulated time. These events are placed on the Executive and ordered by time, priority, and order of creation.

The constructor has package scope because only the Executive class can make events.

Parameters

theAction

the action for the event

theTime

the time that the event will be scheduled to occur

thePriority

the priority associated with the event, smaller is more important

theMessage

an object of type T attached to the event

theName

the name of the event

theModelElement

the model element that scheduled the event

the type associated with the (optional) message sent with the event

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Gets a flag indicating whether the event is to be canceled or not. True implies that the event is to be canceled. It is up to the executive to handle the cancellation. If the event is canceled, it's execute method will not be called when it becomes the current event. Thus, an event can be canceled or uncanceled at any simulated time prior to when the event is scheduled to occur. It is an error to attempt to cancel an event that is not scheduled.

Link copied to clipboard

Allows the association of an Entity with the event

Link copied to clipboard
val id: Long

Unique number assigned when the event is scheduled

Link copied to clipboard

The difference between when the event will occur and the time that it was created (placed on the calendar)

Link copied to clipboard

Whether the event is scheduled. The executive should indicate if the event is scheduled

Link copied to clipboard
val message: T?

An optional message attached to the event

Link copied to clipboard
var name: String?
Link copied to clipboard

The priority associated with the event

Link copied to clipboard

The time that the event will occur

Link copied to clipboard

The time that the event was created and placed on the calendar

Link copied to clipboard

The time from the current time until time that the event will occur

Functions

Link copied to clipboard
open operator override fun compareTo(other: KSLEvent<*>): Int

Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

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

Provides a string representation for the event. Useful for tracing