The Process module has been implemented to represent all the
possible actions that can be defined.
The duration of the process is defined by an external process,
connected to the module using the entityStart and entityEnd
ports.
Each received entity is counted to record the number of received
entities. Also, an special attribute (the processStarttime) is
assigned with the current simulation time to store the time the
entity entered the module.
Depending on the selected action, the entity will be sent to the
external process (that calculates the delay), if no seize action is
selected, or otherwise to the Queue and Seize blocks. The Queue and
Seize blocks manage the seize operation of the resource, that is
connected to the Process module using the S and ACK ports.
After the seize operation, a tally indicator records the time spent
by the entity waiting for the resource, and the processStartTime
attribute is assigned again to store the beginning of the external
process.
The connection with the external process substitutes the delay
block of the normal Process module. When an entity is ready to be
processed, the entityStart port is assigned with the value of the
message that transports that entity (which is a reference to the
entity in memory). The external process need to detect the changes
in the value of that port, and receive new entities. When the
entities finish the process, the reference of the entity has to be
assigned to the entityEnd port. That port is connected to a
quantizer model, that detects the changes, and continues with the
operation of the module.
After the delay, and depending on the selected action, the entity
will be sent to the Release block or to the Count block, that
represents the exit of the module.
The Release block manages the release of the previously seized
resource, sending the release petition through the port R. The last
count block stores the number of entities that depart the module,
and the tally records the amount of time spent in the process.