12.2.2. Implementation with AnyLogic

Since AnyLogic does not support modeling plain activities (in Activity Networks), but only processing activities (in PNs with "entities flowing through the system"), it does not allow a straight-forward coding of the Load-Haul-Dump process design model (and its underlying class model). Rather, we have to figure out what we could use as "entities" for being able to make an AnyLogic PN model.

One option is to use the five trucks of the haul service company as the entities (called "agents" in AnyLogic), which arrive at a truck entry node and "flow" through the processing nodes Load, Haul and Dump before they leave the system via a truck exit node. Although this approach is quite artificial, imposing the PN paradigm on the given problem, it allows us using AnyLogic.

Notice that AnyLogic, like many other simulation tools, has adopted the Seize-Delay-Release pattern for modeling resource-constrained activities introduced by the simulation language GPSS in 1961. This means that activities are essentially modeled as Delay elements.

Implementing the Information Design Model with AnyLogic

From the information design model, we can only take the following items into consideration:

  1. All model variables are implemented as AnyLogic variables (defined in Main).
  2. The duration functions defined in activity types are implemented as the Delay times of corresponding AnyLogic Delay or Service elements.
  3. The resource roles defined for activity types are implemented either as Seize elements or as Seize information items within Service elements (if they had not to be transformed into entities, like the trucks of the Load-Haul-Dump model).

For instance, the activity type Load with its resource roles wheelLoader and truck, as defined in , is implemented as a Service element with

  1. its duration function, sampling the U(10,20) distribution, entered as "uniform(10,20)" in the Delay time field of the Load Service element.
  2. its resource role wheelLoader entered in the form of a resource pool wheelLoaders in the Resource pool field of the Load Service element, and its resource multiplicity constraint of exactly one entered as "1" in the field number of units.
Implementing the Process Design Model with AnyLogic

For facilitating a comparison between the DPMN process design model and the corresponding AnyLogic process model, we show the DPMN model again:

???

While the DPMN process starts with the event HaulRequest, the AnyLogic process starts with the entry node truckEntry (a "source" element) having the field "Arrivals defined by" set to "Calls of inject() function", which means that, for creating 5 trucks arriving at truckEntry, the inject function needs to be invoked in the "On startup" procedure of Main in the following way: truckEntry.inject(5).

For simplicity, the activity nodes GoToLoadingSite and GoHome of the DPMN model are discarded.

???
Figure 12-18. An AnyLogic process diagram for the Load-Haul-Dump business process.

As explained above, the activity type Load is implemented as a Service element with a "Delay time" of "uniform(10,20)" and the field "Resource pool" set to "wheelLoaders" with "number of units" set to 1.

All other activity types are implemented as Delay elements (with a "Delay time" provided by their duration function defined in the class model).

The two decision diamonds of the DPMN model are implemented with corresponding "SelectOutput" elements called "test_if_job_done_1" and "test_if_job_done_2".

Unfortunately, PN modeling tools, like AnyLogic, do not support the general concept of activities (and Activity Networks), but only the special concept of processing activities. A processing activity has a processing object ("entity") as a mandatory participant, in addition to resource objects. While in a PN model, processing nodes do have a location and a processing capacity (the number of processing objects that can be processed in parallel), the nodes of an Activity Network (like the Load-Haul-Dump model), representing pure activities, in general do neither have a processing capacity nor a location.

For instance, in the AnyLogic Load-Haul-Dump model above, trucks are processing objects and the processing activity Load is performed at the processing node Load by a wheel loader that is processing a truck. Consequently, the Load, Haul, Dump and GoBack elements in the AnyLogic process diagram do not represent activities, but rather processing nodes.