10.1.2. Implementation with AnyLogic
We want to implement the Make-and-Deliver-Pizza business process model of Section 10.1 with AnyLogic. For the reader's convenience, we show this model again in the following diagram:
In addition to the simulation model expressed by this DPMN diagram, we also need the data of a simulation scenario, like the initial states of variables and objects, including the resource pools, for being able to run a simulation. We use a baseline scenario with 2 order takers, 6 pizza makers, 3 ovens, and 10 scooters.
Since AnyLogic does not support Activity Network simulations, but only Processing Network (PN) simulations with "entities flowing through the system", we need to impose a PN view on the Make-and-Deliver-Pizza business process. This requires to figure out what could be used as "entities" for being able to make a PN model.
Since in the real pizza service system there are no entities that flow through the system, we need to assume an artificial abstract entity like "the order", which arrives at the order taker and then takes the form of the ordered pizza being delivered to the customer.
An enriched DPMN process design model, like the Make-and-Deliver-Pizza process model above, can be implemented with AnyLogic's Process Modeling Library by taking the following steps:
- An exogenous event circle, like OrderCall, is turned into an entry node OrderCall (an AnyLogic "Source" element). Since the OrderCall event recurrence is defined case-wise for each of the five hours of the pizza service's operation, we set the field Arrivals defined by to "Rate schedule" and set the field Rate schedule to the schedule that defines the arrivals ("ArrivalSchedule").
The TakeOrder activity rectangle is implemented as a corresponding processing node (an AnyLogic "Service" element) by taking the following steps:
- The performer role orderTaker:OrderTaker (in the diagram
abbreviated by :OrderTaker) is turned into a resource pool
assignment in two steps:
- Defining an AnyLogic "Resource Pool" with name orderTakers and its field Capacity set to the resource pool size defined by the chosen simulation scenario (like 2 in the baseline scenario).
- Setting the Seize field to "units of the same pool" and setting the Resource pool field to the previously defined pool orderTakers (by selecting it from the drop-down list), while keeping the default value "1" in the field number of units corresponding to the default resource multiplicity constraint of "exactly one" of the performer role :OrderTaker.
- Since the TakeOrder task queue is unbounded, the yes/no field Maximum queue capacity has to be checked.
- The field Delay time is set to an AnyLogic Java expression corresponding to the activity's duration value: uniform(1,4).
- Since the TakeOrder activity has a waiting timeout, the yes/no field Queue: exit on timeout has to be checked and the field Timeout is set to an AnyLogic Java expression corresponding to the activity's waiting timeout value: uniform_discr(3,6), in the "Service" element's Advanced section.
- Finally, the LostOrder event circle is implemented as a LostOrder exit node (an AnyLogic "Sink" element) attached to the "Service" element's timeout out-port.
- The performer role orderTaker:OrderTaker (in the diagram
abbreviated by :OrderTaker) is turned into a resource pool
assignment in two steps:
The MakePizza activity rectangle is implemented as a corresponding processing node (an AnyLogic "Service" element) by taking the following steps:
- The performer role pizzaMakers:PizzaMaker is turned into
a resource pool assignment in two steps:
- Define an AnyLogic "Resource Pool" with name pizzaMakers and set its field Capacity to the resource pool size defined by the chosen simulation scenario (like 6 in the baseline scenario).
- Set the Seize field to "(alternative) resource sets" and then create an entry in the field Resource sets (alternatives) by selecting the pool pizzaMakers from the drop-down list and changing its default value "1" for the resource multiplicity to "2" (because "exactly 2" pizza makers are required).
- The resource role oven:Oven is turned into a resource
pool assignment in two steps:
- Define an AnyLogic "Resource Pool" with name ovens and set its field Capacity to the resource pool size defined by the chosen simulation scenario (like 3 in the baseline scenario).
- Create another entry in the field Resource sets (alternatives) by selecting the pool ovens from the dropdown list (and leaving its default value "1" for the resource multiplicity).
- Since the MakePizza task queue is unbounded, the yes/no field Maximum queue capacity has to be checked.
- The field Delay time is set to an AnyLogic Java expression corresponding to the activity's duration value: triangular(3, 6, 4).
- The performer role pizzaMakers:PizzaMaker is turned into
a resource pool assignment in two steps:
The DeliverPizza activity rectangle is implemented as a corresponding processing node (an AnyLogic "Service" element) by taking the following steps:
- For simplicity, the performer role scooterDriver:ScooterDriver (in the diagram abbreviated by :ScooterDriver) is merged with the resource role scooter:Scooter (abbreviated by :Scooter).
- The resource role scooter:Scooter is turned into a
resource pool assignment in two steps:
- Define an AnyLogic "Resource Pool" with name scooters and set its field Capacity to the resource pool size defined by the chosen simulation scenario (like 10 in the baseline scenario).
- Set the Seize field to "units of the same pool" and set the Resource pool field to the previously defined pool scooters (by selecting it from the drop-down list), while keeping the default value "1" in the field number of units corresponding to the default resource multiplicity constraint of "exactly one" of the resource role :Scooter.
- Since the DeliverPizza task queue is unbounded, the yes/no field Maximum queue capacity has to be checked.
- The field Delay time is set to an AnyLogic Java expression corresponding to the activity's duration value: triangular(10, 30, 15).
The result of these model implementation steps is shown in the following AnyLogic process diagram:
Notice that for measuring the cycle time of MakePizza activities, the corresponding processing node is included in a TimeMeasureStart-TimeMeasureEnd pair of time measurement nodes (startTime and endTime).
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 Make-and-Deliver-Pizza model), representing pure activities, in general do neither have a processing capacity nor a location.
For instance, in the AnyLogic Make-and-Deliver-Pizza model above, "orders" are processing objects and the processing activity TakeOrder is performed at the processing node TakeOrder by a pizza maker that is processing an "order". Consequently, the TakeOrder, MakePizza and DeliverPizza elements in the AnyLogic process diagram do not represent activities, but rather processing nodes.
Implementing the Enriched Process Design Model with AnyLogic
T.B.D.