Example

Initial Data:

Imagine you need to simulate performance of a gas station. There is a 5 cubic meters petrol storage tank there. On average, each car is refueled with 20 liters.

We know the distribution of the number of incoming customers per day and it is known that 600 cars arrive at the gas station per day.

It is also known that as soon as less than 1000 liters remain in the gasoline storage, we should do some actions to refill the storage with gasoline. The refilling process takes 1 hour and exactly in an hour a new portion of gasoline in the amount of 4000 liters is poured into the gasoline storage tank and is ready for further distribution.

Design Activity Model

1. Add 2 objects to the "Functional objects" repository and name them Gasoline and Fuel Dispenser. Define their properties as you see in Figures 1 and 2.

Figure 1. Gasoline object Properties Window (Simulation properties tab)
Figure 2. Fuel Dispenser object Properties Window (Simulation properties tab)

2. Design the "Serve a customer" process diagram (Figure 3):

Figure 3. The "Serve a customer" process diagram

Design the "Refill the storage tank" diagram (Figure 4):

Figure 4. The "Refill the storage tank" process diagram

As a result, you should get the following structure in the "Activities" repository in the Explorer (Figure 5):

Figure 5. Activities tree

3. Create an Event instantiation model for the "Customer arrived" start event ("Events" repository object Properties WindowSimulation properties tab → Event instantiation model tab). See Figure 6 for details:

Figure 6. Event instantiation model of the "Customer arrived" start event

The Interval settings are the same for all 3 models (Figure 7):

Figure 7. Interval settings of the Event instantiation models

See Figure 8 for the settings of the Distribution property value for the 1st model:

Figure 8. The Distribution property value for the 1st model

See Figure 9 for the settings of the Distribution property value for the 2nd model:

Figure 9. The Distribution property value for the 2nd model

See Figure 10 for the settings of the Distribution property value for the 3rd model:

Figure 10. The Distribution property value for the 3rd model

As a result, when you click on the Simulate event instance activations hyperlink, you get the following picture (Figure 11):

Figure 11. Modeling moments of event instance occurrences

4. Setup properties of the "Refuel a car" activity ("Activities" repository object Properties WindowSimulation properties tab). See Figure 12 for details:

Figure 12. Simulation properties of the "Refuel a car" activity

5. Setup properties of the arrow that follows the XOR gateway (Figure 3). The second arrow that follows the XOR gateway, is a Default sequence flow, and you don’t need to fill out its properties.

Figure 13. Arrow Properties Window

6. Setup properties for the "Pour gasoline into the tank" activity in accordance with the Figure 14:

Figure 14. Properties of the "Pour gasoline into the tank" activity (Properties WindowSimulation properties tab)

7. Run simulation of the "Serve a customer" and "Refill the storage tank" processes. Setup the properties of the Simulation Properties Window in accordance with the Figure 15:

Figure 15. Simulation Properties Window

Analyze Simulation Results

First of all, you need to run the simulation. Go to the Variables tab of the Simulation progress window to see the change of the "Quantity" system variable of the "Gasoline" object (Figure 16):

Figure 16. Simulation progress window, Variables tab

You see that the value of the "Quantity" variable is rather big. And that’s the result we get at the end of the simulation period.

To find out the reason for it, go to the Activities tab. Note that the number of the "Pour gasoline into the tank" task instances is rather big as well (Figure 17).

Figure 17. Simulation progress window, Activities tab

Now close the Simulation progress window and go to the Simulation Properties Window to continue the analysis. Click on the Variables statistics hyperlink and analyze the dynamics of the "Quantity" variable values (the "Gasoline" object):

Figure 18. The "Quantity" variable change (the "Gasoline" object)

Now we need to find out the reason of the frequent activation of the "Pour gasoline into the tank" task.

In fact, we haven’t thought through the conditions of moving to the next step of the "Serve a customer" process instance in the branching point (see Figure 3). According to the conditions we have defined, as soon as the value of the "Quantity" variable becomes less than 1,000, each new instance of the "Serve a customer" process activates the "Refill the storage tank" task instance. But it doesn’t reflect the reality. The "Refill the storage tank" task should be activated only once. And while this task is performed it should not be activated any more.

Modify Simulation Model

Let’s change our simulation model.

Let’s add one more variable for the "Gasoline" object (Figure 19):

Figure 19. "Gasoline" object Properties Window ("Material objects" repository, Variables tab)

Next, we edit the "Report the need to refuel the storage tank" activity properties. Open the Operations on variables tab (on the Simulation properties tab in the activity Properties Window) and add an operation there (Figure 20):

Figure 20. Operations on variables tab of the "Report the need to refill the storage tank" activity Properties Window)

Now we add one more operation on the same variable to the Operations on variables tab of the "Pour gasoline into the tank" activity (Figure 21):

Figure 21. Operations on variables tab of the " Pour gasoline into the tank" activity Properties Window)

Open the Properties Window of the arrow that follows the XOR gateway in the "Serve a customer" process diagram and add one more condition there (Figure 22):

Figure 22. Properties Window of the arrow (Conditions tab))

Thus, we have modified the model. Now as soon as the value of the "Quantity" variable of the "Gasoline" material resource is less than 1,000 liters, the "Refill the storage tank" process is activated and the "Refill storage tank checkbox" variable value changes. New instances of the "Refill the storage tank" process are not activated until the "Refill storage tank checkbox" variable value becomes 0 again.

Let’s run the simulation again with all the same settings as before.

Analyze Simulation Results of the Modified Model

Again, we analyze the change of the "Quantity" variable during the simulation period. Use the Variables tab in the Simulation progress window for it (Figure 23):

Figure 23. Simulation progress window, Variables tab

Now let’s open the Activities tab to find out the number of the "Refill the storage tank " process completed instances. Note that the number has significantly decreased (Figure 24):

Figure 24. Simulation progress window, Activities tab

The dynamics of the "Quantity" variable change can be also seen in the Simulation Properties window by the Variable statistics hyperlink (Figure 25):

Figure 25 The "Quantity" variable change (the "Gasoline" object)

You see that "unwanted" instances of the "Refill the storage tank" process are not activated. Chronology of each process instance can be seen in the Process chronology window (Figure 26):

Figure 26. The "Refill the storage tank" process chronology

If you open the Variable statistics window and analyze the changelog, you will see that some instances of the "Refuel a car" task instance tried to modify the "Quantity" variable value instance, but failed, because the variable value was equal to its minimum value (Figure 27):

Figure 27. The "Quantity" variable instance value changelog

Let’s analyze chronology of the 201st instance of the task (Figure 28). The number of the "Serve a customer" process instances equals the number of the "Refuel a car" process instances; thus, the regarded task instance has the same number as the process instance in the Variable statistics window.

Figure 28. The 201st "Refuel a car" process instance chronology

Remember that there is the following order of events that happen to the task instance when it is activated:

  1. First, it waits in case the technological wait time is defined for it.
  2. Second, it waits for the sufficient number of material resources.
  3. Third, operation on a variable instance is performed (in case it is supposed to be performed when entering a task instance).
  4. Fourth, it waits for the work resources.
  5. Fifth, it is performed.
  6. Sixth, operation on a variable instance is performed (in case it is supposed to be performed when exiting a task instance).

Now let’s analyze the statistical data taking statistics of the "Serve a customer" process as an example (Figure 29):

Figure 29. The "Serve a customer" Simulated process statistics window

Open the Duration histogram of the "Serve a customer" process (Figure 30):

Figure 30. Duration histogram

See Figure 31 for the Queue time histogram of the "Serve a customer" process. It shows the time spent by process instances in the queue of the Fuel Dispenser work resource.

Figure 31. Queue time histogram

And see Figure 32 for the Time of waiting for material resources histogram of the "Serve a customer" process. It shows the time spent by process instances waiting for the sufficient amount of the Gasoline material resource:

Figure 32. Time of waiting for material resources histogram
« PreviousLevel upNext »
 
Driven by DokuWiki