Entity
An entity is something that can experience processes and as such may wait in queue. It is a subclass of QObject. The general approach is to use the process() function to define a process that a subclass of Entity can follow. Entity instances may use resources, signals, hold queues, etc. as shared mutable state. Entities may follow a process sequence if defined.
Parameters
an optional name for the entity
Inheritors
Types
A blockage is like a semaphore or lock. A blockage can be used to block (suspend) other entities while they wait for the blockage to be cleared. The user can mark process code with the start of a blockage and a subsequent end of the blockage. While the entity that creates the blockage is within the blocking code, other entities can be made to wait until the blockage is cleared. Only the entity that creates the blockage can start and clear it. A started blockage must be cleared before the end of the process routine that contains it; otherwise, an exception will occur. Thus, blockages that are started must always be cleared. The primary purpose of this construct is to facilitate process interaction between entities. Using blockages should be preferred over raw suspend/resume usage and even the use of Suspension instances.
A BlockingActivity is an activity that may block other entities as they wait for the activity's delay to complete.
Represents the movement of the entity from the specified location to the specified location at the supplied velocity. This wraps the movement within a blockage which will cause entities that are waiting for the movement to complete to block (suspend) until the movement is completed.
A BlockingResourcePoolUsage represents the usage of a pool of resources that may block other entities while the usage occurs. Equivalent to: seize(), delay(), release()
A BlockingResourceUsage represents the usage of a resource that may block other entities while its usage occurs. Equivalent to: seize(), delay(), release()
A BlockingTask is a task that takes time to complete and will block the process of an entity that will wait for it to complete.
Represents some amount of units needed from 1 or more resources
An abstraction that represents a general suspension point within a process. Suspensions are one-shot. That is, once resumed they cannot be used again unless passed through the suspend(suspension: Suspension) function for a KSLProcess.
Properties
Controls whether the entity goes through the function dispose() of its containing ProcessModel. The default is true.
If an entity is using a conveyor (has requested and received cells) this returns the request. If null, then the entity should not be using a conveyor. This is set via the requestConveyor() suspending function to the request and to null when the entity exits the conveyor.
If supplied, this process will be the process activated by an EntityGenerator that creates and activates the entity.
Indicates if the entity has active (started) blockages within a process. A blockage is considered active if it has been started within a process routine. If no blockages have been created or started, this will return false.
True if a process has been scheduled to activate
If not null, the name of the process scheduled to activate
Provides access to the entity's processes by name
Provides a list of processes for the entity to follow before being disposed
An iterator over the entity's current process sequence. If a process sequence is supplied and the property useProcessSequence is true then the iterator is used to determine the next process for the entity to execute.
Controls whether the entity uses an assigned process sequence via the processSequence property at the end of successfully completing a process to determine the next process to experience. The default is false.
The default velocity for the entity's movement within the spatial model of its ProcessModel
Functions
A string representation of the allocations held by the entity. Useful for printing and diagnostics.
A string representation of the active blockages for the entity. Useful for printing and diagnostics.
Computes the number of different allocations of the resource held by the entity.
If the entity is executing a process and the process is suspended, then the process is scheduled to resume at the specified simulation time. This schedules an event that eventually resumes the process.
If the entity is executing a process and the process is suspended, then the process routine is terminated. This causes the currently suspended process to exit, essentially with an error condition. No further processing within the process will execute. The process ends (is terminated). All resources that the entity has allocated will be deallocated. If the entity was waiting in a queue, the entity is removed from the queue and no statistics are collected on its queueing. If the entity is experiencing a delay, then the event associated with the delay is cancelled.
Computes the total number of units of the specified resource that are allocated to the entity.