Process Model
A process model facilitates the modeling of entities experiencing processes via the process view of simulation. A ProcessModel has inner classes (Entity, EntityGenerator, etc.) that can be used to describe entities and the processes that they experience. The key class is Entity, which has a function process() that uses a builder to describe the entity's process in the form of a coroutine. An entity can have many processes described that it may follow based on different modeling logic. A process model facilitates the running of a sequence of processes that are stored in an entity's processSequence property. An entity can experience only one process at a time. If using a sequence, after completing a process, the entity will try to use its sequence to run the next process (if available). Individual processes can be activated for specific entities.
See KSLProcessBuilder for documentation on the functionality provided for processes.
Parameters
the parent model element
an optional name for the process model
Inheritors
Types
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.
Note that an EntityGenerator relies on the entity having a defined default process. The generator will create the entity and activate the default process. If the entity does not have a default process then an illegal state exception will occur. You can specify the default process via the isDefaultProcess parameter of the process() function or directly via the defaultProcess property of the entity.
Note that an EntitySequenceGenerator relies on the entity having at least one process that has been added to its process sequence and the entity's addToSequence property being true. The generator will create the entity and activate the process that is listed first in its process sequence. If the entity does not have any processes in its process sequence then an illegal state exception will occur.
This class will activate the entity's default process or the process provided by the process name argument. When the increment counter reaches the supplied initial count limit the entity's process will be activated. If the reset count option is true the internal counter is reset and additional entities will be created and activated when the count again reaches the limit. If the supplied process name is null (or not a named process for the entity), then the entity's default process will be activated. If both are unspecified, then an error occurs.
Functions
Cause the entity to start the process. The activation of the process is governed by an event that is scheduled to occur at the specified activation time.
It is essential that subclasses that override this function call the super. This ensures that suspended entities are cleaned up after a replication
This method is called when the entity has been activated, run at least one process and has no further processes to run. Subclasses can override this method to provide logic after all processes have been completed by the entity. By default, nothing happens.
Cause the entity to start the process sequence in the order specified by the sequence. The activation of the first process is governed by an event that is scheduled to occur based on the time until activation parameter.
Cause the entity to start the process sequence in the order specified by the sequence. The activation of the first process is governed by an event that is scheduled to occur at the specified activation time.