TaskDispatcher

open inner class TaskDispatcher(parent: ModelElement, name: String? = null, discipline: Queue.Discipline = Discipline.FIFO) : ModelElement(source)

Constructors

Link copied to clipboard
constructor(parent: ModelElement, name: String? = null, discipline: Queue.Discipline = Discipline.FIFO)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Can be used to cause performance statistics to be collected about any transient task processors used by the dispatcher. This function creates model elements. The normal use of this function would be within an init block in order to configure behavior prior to the running of any experiments.

Link copied to clipboard
protected open fun dispatch(processor: TaskProcessingSystem.TaskProcessorIfc)

Called to cause a task to be sent to the supplied processor. If the dispatcher has a task for dispatching the task is selected via the nextTask() function and then the processor is told to receive the task for processing.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
protected open override fun initialize()

This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called

Link copied to clipboard
protected open fun nextTask(): TaskProcessingSystem.Task?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Receives tasks and attempts to dispatch them. Selects a processor via the selectProcessor() function and then dispatches the task to the processor with the dispatch() function.

Link copied to clipboard

Registers the processor to receive tasks that are dispatched by the dispatcher.

Link copied to clipboard

Selects a processor to receive the next task to be dispatched. The default is to select the first processor that is idle and is not shutdown. Idle implies that the processor is not failed (in-repair), busy, or inactive.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
protected open fun taskCompleted(task: TaskProcessingSystem.Task)

Called when a formally dispatched task is completed.

Link copied to clipboard

Unregisters the processor so that it no longer receives tasks from the dispatcher.

Link copied to clipboard
protected open override fun warmUp()

This method should be overridden by subclasses that need actions performed at the warm-up event during each replication. It is called once during each replication if the model element reacts to warm-up actions.