Signal

class Signal @JvmOverloads constructor(parent: ModelElement, name: String? = null, discipline: Queue.Discipline = Queue.Discipline.FIFO) : ModelElement(source)

The purpose of this class is to hold entities that are waiting for a signal while executing a KSLProcess. A reference to this class can be used to signal specific, any, or all the entities waiting to proceed within their process.

Parameters

parent

the parent (containing) model element

name

the name of this signal

discipline

the queue discipline for the internal queue that holds the waiting entities

Constructors

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

Properties

Link copied to clipboard

Functions

Link copied to clipboard

An immutable list representation of the holding queue. While the list is read-only, the elements can be changed. Thus, some care may be needed to understand the effects of such changes. This view is mainly to provide the abilities available in the Kotlin collection classes to working with the waiting entities, which may be used to determine which entities to signal.

Link copied to clipboard
fun signal(predicate: Predicate<ProcessModel.Entity>, resumePriority: Int = ProcessModel.RESUME_PRIORITY)

Signals the entities that match the predicate to resume their processes if they are waiting for the signal.

fun signal(rank: Int = 0, resumePriority: Int = ProcessModel.RESUME_PRIORITY)

The entity removes itself from the waiting condition. If there are no entities, or the rank is out of range, then nothing happens (no signal)

fun signal(entities: List<ProcessModel.Entity>, resumePriority: Int = ProcessModel.RESUME_PRIORITY)

Signals the entities in the list to resume their processes if they are waiting for the signal.

fun signal(range: IntRange, resumePriority: Int = ProcessModel.RESUME_PRIORITY)

The entities remove themselves from the waiting condition.

fun signal(entity: ProcessModel.Entity, resumePriority: Int = ProcessModel.RESUME_PRIORITY)

Use this to signal a specific entity to move in its process. The entity removes itself from the waiting condition.

Link copied to clipboard
fun signalAll(resumePriority: Int = ProcessModel.RESUME_PRIORITY)

All the entities are signaled to proceed in their process. The entities remove themselves from the waiting condition.

Link copied to clipboard
fun signalFirst(resumePriority: Int = ProcessModel.RESUME_PRIORITY)

If the queue is not empty, the first entity in the queue is signaled to proceed.

Link copied to clipboard
fun signalLast(resumePriority: Int = ProcessModel.RESUME_PRIORITY)

If the queue is not empty, the last entity in the queue is signaled to proceed.