modelExternalProcess

Process applied to the entities (with external process duration)

Information

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.

Parameters

TypeNameDefaultDescription
Stringname"ExternalProcess"name of the module
IntegerAction1Action to be performed by process
IntegerPriority2priority to seize resource
IntegerAllocation1
String[5]stattype{"VATime", "NVATime", "WaitTime", "TransferTime", "OtherTime"}

Connectors

TypeNameDefaultDescription
DEVSLib.SRC.Interfaces.inPortIn
DEVSLib.SRC.Interfaces.outPortOut
DEVSLib.SRC.Interfaces.inPortACK
DEVSLib.SRC.Interfaces.outPortS
DEVSLib.SRC.Interfaces.outPortR
Modelica.Blocks.Interfaces.IntegerOutputentityStart
Modelica.Blocks.Interfaces.IntegerInputentityEnd

Components

TypeNameDefaultDescription
IntegerResourceUnits1Units of resource to seize/release
Integereinlast entity that entered the module
Integereoutlast entity that left the module
SIMANLib.Blocks.Queueq
SIMANLib.Blocks.Seizeseize
SIMANLib.Blocks.Releaserelease
Queuequeue
DEVSLib.AuxModels.Selectselect
DEVSLib.AuxModels.Selectselect1
SIMANLib.Blocks.Countcount
SIMANLib.Blocks.Countcount1
SIMANLib.Elements.CounternumberIn
SIMANLib.Elements.CounternumberOut
SIMANLib.Elements.TallyStatTime
SIMANLib.Blocks.Tallytally5
String[5]statcost{"VACost", "NVACost", "WaitCost", "TransferCost", "OtherCost"}
SIMANLib.Blocks.Assignassign
SIMANLib.Elements.DStatNumberInQueue
SIMANLib.Elements.TallyQueueWaitTime
SIMANLib.Blocks.TallyqueueWaitTime
SIMANLib.Blocks.Assignassign2
SIMANLib.Elements.AttributeprocessStartTime
DEVSLib.SRC.Hybrid.DiCodiCo
DEVSLib.SRC.Hybrid.Quantizerquantizer
Modelica.Blocks.Math.IntegerToRealintegerToReal
Modelica.Blocks.Math.RealToIntegerrealToInteger