Up to this point, you've built a basic transportation task sequence for the two task executers in the model. You can actually create this basic functionality without using the Process Flow tool. However, the real power in using the Process Flow tool is how easy it is to create custom model logic, especially for task sequences.
In this tutorial task, you'll add process flow logic that will occasionally interrupt the operator's normal transportation task sequences. You'll design logic that will send operators to a get a drink from the drinking fountain every time they travel more than 100 meters.
In order to create this logic, you'll build an additional section in the process flow for a water break task sequence. Also, recall from the previous tutorial that the resource shared asset is linked to the two operators in the 3D model. In order to create the water break tasks, you'll need the resource shared asset to keep track of the distance the operators have traveled. For that reason, you'll need to change the resource so that it acts a little more like the list. Lists can track and update data about the entries on the list; you can also build queries that pull entries from the list that match specific criteria.
Fortunately, resources actually have an internal list that you can set up to have the same functionality as a list. In this tutorial task, you'll learn how to set up the resource's internal list to track the total distance the operators have traveled in the simulation model and the distance they've traveled since their last water break. You'll also design a query so that your water break task sequence will pull any operators who have traveled more than 100 meters since their last water break.
When you're finished, your model will work similar to the following image:
Now that your basic transportation task sequence is set up, you'll create a series of tasks that will occasionally pull the operator away from their normal transportation tasks and send them to get a drink of water. You'll want to simulate the operator getting a drink from the drinking fountain after the operator has traveled more than 100 meters.
By now you may have noticed that the list and resource shared assets have somewhat similar functions. In fact, resources are simply a special kind of list. The resource you're using in this process flow actually keeps an internal list of the available operators. The Acquire Resource and Release Resource activities push and pull operators from this list.
In this step, you'll need to add some fields to this internal list in order to add the water break functionality in a later step. You'll add two fields:
To add these fields to the resource's internal list:
Consider saving your simulation model.
In this step, you'll add some more activities to the process flow. These activities will control the water break functionality. When you're finished, your process flow will look similar to the following image:
For now, you'll merely add and connect these activities to the process flow. You'll edit the properties to add the functionality in a later step.
To add and connect these activities:
Activity | New Name |
---|---|
Source | Source: Start Simulation |
Acquire | Acquire: Get Thirsty Operator |
Travel | Travel to Water Fountain |
Delay | Delay: Drinking |
Assign Labels | Assign Labels: lastDrinkTotalTravel |
Release | Release Operator |
Consider saving your simulation model.
In this step, you'll edit the properties for the activities in the Water Break section of the process flow to create a simple transportation task sequence. The following is an overview of how each activity in this section will function:
Activity | Explanation |
---|---|
Source: Start Simulation | This Scheduled Source activity will create one token as soon as the simulation starts. It will then send the token to the Acquire: Get Thirsty Operator activity. After it creates this token, it won't create any additional tokens. The one token will simply loop continuously through the other activities until the simulation ends. |
Acquire: Get Thirsty Operator | This activity will check the resource's internal list for any operators who have traveled more than 100 meters since their last water break. When an operator on the list matches that criteria, it will acquire that operator. If an operator doesn't match that criteria, it will create a back order on the list. You'll create a label called thirstyOperator on the token to track which operator has been assigned to take a water break. |
Travel to Water Fountain | Sends the operator to the water fountain. |
Delay: Drinking | This task will simulate the length of time it takes an operator to get a drink from the fountain. |
Assign Labels: lastDrinkTotalTravel | This activity will record the time the operator last got a drink from the fountain. |
Release Operator | Releases the operator so that it can work on another transportation task sequence. |
To edit these activity properties:
token.thirstyOperator
.WHERE totalTravel - lastDrinkTotalTravel > 100
.30.00
.lastDrinkTotalTravel
.getvarnum(token.thirstyOperator, "totaltraveldist")
.Consider saving your simulation model.
In this step, you'll add the lastDrinkTotalTravel label to the operators and set its initial value to 0. You need to do this in order for the logic to work. Unless you set the initial value to 0, this label will return a NULL value when calculating how long it has been since the operator last took a drink. If that happens, the Acquire: Get Thirsty Operator activity won't be able to successfully pull an operator from the resource's internal list.
To add these labels:
0
.Consider saving your model.
In this step, you'll run the simulation model to ensure that it is functioning correctly. Before running the model:
Be aware that the following model is being run at speed 10.00:
As the model runs, notice that when the operators travel more than 100 meters, they go to get a drink from the drinking fountain. After their first drink, the resource's list begins tracking the amount of travel from their last drink.
Now you've seen some of the different possible uses for both resources and lists. In the next tutorial task, you'll learn how to use the last type of shared asset: the zone. Continue on to Tutorial Task 1.3 - Add a Zone to Collect Data.