article

Paul Toone avatar image
0 Likes"
Paul Toone posted BenJoaquin Gouverneur commented

Tutorial - Process Flow Basics   

This tutorial is designed to give you a hands-on introduction to the Process Flow module. In this tutorial you will create a very simple process flow that runs as its own independent simulation model. Be aware that in this tutorial, you will not learn how to link a process flow to a 3D simulation model yet. Connecting a process flow to a 3D simulation model will be covered in the Linking Process Flows to 3D models tutorial.

In this tutorial, you'll create a simulation model of a post office with one service window. Customers will be represented by tokens, which will arrive approximately every 60 seconds. The service time at the window is about 45 seconds. If a customer waits for longer than 200 seconds, they will leave the post office without going to the service window and will be considered an unhappy customer.

Tasks Covered

This tutorial will cover the following tasks:

  1. Adding and connecting process flow activities
  2. Renaming and resizing activities
  3. Linking Shared Asset activities
  4. Editing activity properties
  5. Creating a Process Flow chart
  6. Running the simulation and gather information
  7. Using labels and Decide activities to add complexity

For More Information

For more in-depth information about the concepts covered in this tutorial, refer to the following topics:

Step 1 - Adding and Connecting Process Flow activities

In this first step, you'll create a process flow. When you're finished with this step, your process flow should look approximately like the following image:

When you create the process flow, you'll make a General Process Flow because this type of process flow is ideal for creating global process flows. Then, you'll begin adding and connecting some activities to your process flow. (An activity is a logical operation or step in a process flow.) There are a number of different ways you can add and connect activities. In this step, you'll try out all of these methods. You can use whichever method you prefer when you begin building your own process flow.

  1. Create a new model, then click the ProcessFlow button on the main toolbar to open a menu. Select Add a General Process Flow to create a general process flow and open it as a separate tab in the center pane. Also, notice that when the Process Flow view is open and active, the Library changes to display the process flow activities.
  2. First, you'll need to add an activity that will create the tokens that will move through the other activities. In this model, the tokens will represent customers coming to the post office. Since customers will arrive at random, you'll use an Inter-Arrival Source to represent them. From the Library, under the Token Creation group, drag an Inter-Arrival Source activity into the process flow.

  1. Now you'll add an activity that will represent a customer standing in line waiting to receive service from a postal worker at the service window. If the postal worker is busy, the customer will wait in line until the postal worker is free. Because the postal worker is a limited resource, you'll use an Acquire Resource activity for this step in the process flow. From the Library under the Resources group, drag out an Acquire Resource activity and drop it on top of the Source activity. Notice that the two activities have been snapped together, as shown in the following image. They are now automatically connected in a block (also sometimes referred to as a stacked block.)

  1. Now you'll try the second method for adding and connecting an activity using a connection coming out from the stacked block. Point your mouse on the bottom edge of the block. The mouse icon will change to a chain link. Click the edge of the block and, while holding down the mouse, drag it a little bit toward the bottom of the screen. Notice that there is a connector coming from the edge of the block to your mouse pointer. When you release the mouse, the Quick Library will appear. Under the Basic group, click the Delay activity , which will represent the time it takes a postal worker to help a customer. The following animated gif shows this step:

  2. If needed, you can delete a connection by clicking it and pressing the Delete key. You can also change the connector's settings by clicking on it and editing the settings in Quick Properties. You can change the curve of the connection arrow by clicking on it and using the control handles to change its curves.
  3. Now you'll try the last method for adding and connecting a new activity by adding an activity directly to the end of a stacked block. Point your mouse on the bottom edge of the Delay activity. The mouse icon will change to a chain link. Double-click this edge to open the Quick Library again.
  4. Under the Resources group, click on the Release Resource activity . This activity will release the postal worker to help another customer.

  • Using your preferred method, add and connect a Sink activity below the Release Resource activity. The Sink activity will remove the token (the customer) from the model and track the number of customers that exited the process flow through this particular Sink.
  • Now you will need to create an exit point for customers who are unable to get service in a reasonable amount of time. Some activities can have more than one outgoing connector, such as the Acquire Resource activity. Create a second connector coming out from the Acquire activity and connect it to a Sink activity, as shown in the following image. This Sink activity will be for customers (tokens) that will leave if the wait is too long.

  • From the Library, under Resources, drag a Resource activity into the process flow. This activity will represent the postal worker who will help the customers. For now, don't worry about connecting this activity to any other activities.
  • Step 2 - Rename and resize activities

    In this step, you'll rename all of the activities to be more descriptive. When you finish this step, your process flow should look approximately like the following image:

    This step in the tutorial will demonstrate two different methods for renaming activities. Be aware that changing an activity's name will have no effect on the way that activity behaves, but renaming activities will make your process flow a little more intuitive and understandable. This step will also explain how to resize activities, since some of the activities will be too small to display the new names.

    1. Click the first Sink activity (the one connected to the Acquire activity) to select it.
    2. In Quick Properties under Activity Properties, click inside the Name box. Delete the current text and type Unhappy Customers to change the Sink activity's name, as shown in the following image:

    3. Now you'll try the second method of changing an activity name. Double-click the second Sink activity (the one connected to the Release activity) to highlight its name. Type Happy Customers as the new name and hit the Enter key.
    4. Notice that the names of the Unhappy Customers and Happy Customers activities are truncated because they're too long. Now you'll resize the activity block to make the full name visible. Click the Unhappy Customers activity to select it.
    5. Notice that when the activity is selected, the entire border of the activity block turns yellow and the black sizer boxes appear. Click the right middle sizer box on one of the activities and drag it a little to the right until the full name becomes visible. Repeat this step for the activity block.

  • Using your preferred method, rename the following activities as listed in the following table:
    Activity New Name
    Source Customer Arrival
    Acquire Get Service
    Delay Service Time
    Release End Service
    Resource Service Window
  • resize the activities if needed.
  • Step 3 - Link Shared Asset activities

    You might have noticed that the Resource activity is a different color than the other activities. That's because it is a shared asset. Shared assets don't interact with tokens the way other activities do. They can be used to build complex logic into process flows by controlling access to resources. (See About Shared Assets for more information.) The post office model will begin with only one employee, which is represented by the Resource shared asset in this model. In one sense, the post office employee is a finite resource. When that employee is busy helping a customer, he or she can't help other customers until the current customer's request has been completed.

    In this step, you'll connect the Acquire Resource activities to the Resource shared asset so that when customers arrive at the post office, they will request access to the service window.

    1. First, you'll connect the resource activities so that when customers arrive at the post office, they will request access to the service window. Click the Get Service activity. Notice there is a red Exclamation icon to the right of the activity. This means that this Acquire Resource activity is not connected to a Resource activity, which is required.
    2. Click the Exclamation icon. The mouse will turn into a sampler to indicate you are in sampling mode.
    3. Click on the Service Window resource to link the two activities. When they are linked, a blue line will appear when the activities are selected.

    When you finish this step, you should be able to click the Get Service activity to select it. Then, you should see that in Quick Properties, the Resource Reference box is now set to Service Window as shown in the following image:

    Fortunately, you don't need to link the Service Window (Resource) shared asset to the the End Service (Release Resource) activity because FlexSim will automatically release any resources that are associated with the tokens when they enter a Release Resource activity.

    Step 4 - Edit activities Properties

    In this step, you'll create the basic logic behind your process flow by editing the activity settings. Using two different methods for editing activity properties, you'll change the customer arrival time schedule, set a maximum wait time for customers, and set the time it takes to provide service to a customer.

    1. First you'll edit an activity's properties using the Quick Properties pane. You'll start by changing the arrival rate for customers so that a customer arrives approximately every minute. Click the Customer Arrival activity to select it.
    2. Notice that Quick Properties displays all the properties for all the activities in this block. In Quick Properties, under the Customer Arrival, change the Inter-Arrivaltime to exponential(0, 60). Now customers will arrive at random intervals, approximately every 60 seconds. As an alternative to typing this code in directly, you can click the arrow next to this property and select Statistical Distribution from the menu to use a different statistical distribution.

    3. Now you'll try a different method for editing an activity's properties. You'll change the maximum wait time so that when a customer waits for more than a few minutes, they get frustrated and leave. Click the Acquire Resource icon (as labeled in the following image) on the Get Service activity to open the activity properties:

    4. In the activity properties, check the Use Max Wait Timer checkbox to turn on the maximum wait time. A few new settings will appear underneath the checkbox.

    5. In the Time box, type 200. 200 seconds is the length of time the customers will wait for the service window before getting frustrated and leaving.
    6. Now you need to determine what happens when the customer reaches the maximum wait time. Click the Edit Properties button next to the OnWaitTimerFired trigger.
    7. Click the arrow next to the Release Token picklist to open its picklist options.
    8. In the Connector box, type 2. This setting will send customers (tokens) that reach the maximum wait time to the second connector: the Unhappy Customers activity.

    9. Click outside of the activity properties to save the changes.
    10. Now you'll change the statistical distribution that calculates the amount of time it takes for a customer to complete their order at the service window. Using your preferred method for changing an activity's properties, open the properties for the Service Time activity. Click the Edit Properties button next to the Delay Time box to open the Distribution Chooser.
    11. From the Distribution menu, select the lognormal2 distribution. Edit the parameters as shown in the following image:

    12. Notice in the chart that most customers will take approximately 91.5 to 93.5 seconds to complete their order, but some might take a little more or less. Click outside the Distribution Chooser to save the changes. Now the Delay Time will read lognormal2(90, 3.1, 0.5, 0).

    If you haven't done so already, consider saving your model.

    Step 5 - Create a Process Flow Chart

    Now that all the logic of your process flow is set up, you'll create a dashboard to record the number of happy customers and unhappy customers created by this process flow.

    1. Click the Unhappy Customers activity to select it.
    2. In Quick Properties, click the Statistics button button to open the statistics window for this activity.
    3. You'll want to track how many tokens enter this activity. So, next to the Input box, click the Pin button to open a menu. Select Pin to New Dashboard to create a new dashboard and add a chart for this statistic, as shown in the following image:

    4. Now you'll add the input for the happy customers to this chart for comparison. Double-click the chart to open its Chart Properties window, as shown in the following image:

    5. In the Name box at the top, delete the current chart name and type Customers instead.
    6. In the Objects tab, click the Sampler button to enter sampling mode. Click the Happy Customers activity to add it to the chart. When you're finished, the list on the Objects tab should display both the Unhappy Customers and Happy Customers activities in its list.
    7. Now you'll make sure that the chart is tracking the current input for both these Sink activities. In the Statistics tab, click Input in the statistics list to select it. Make sure that the Value menu below the list is set to Current.

    8. If desired, you can make any visual changes to the chart in the Colors and General tabs.
    9. Click the OK button to save the changes and close the window. Notice that the chart does not yet display any information because the simulation hasn't started running yet.
    10. Now you'll add one additional chart to your dashboard that will track the average staytime that customers wait for service. Click the Get Service activity to select that block of activities.
    11. In Quick Properties, next to the Name box for the Get Service activity, click the Statistics button button to open the statistics window for this activity.
    12. Next to the Staytime box, click the Pin button to open a menu. Select Pin to Dashboard to add a chart for this statistic to the existing dashboard.
    13. Now you'll change the statistic value and other visual properties for this chart. Double-click the chart to open its Chart Properties window.
    14. In the Name box at the top, delete the current chart name and type Average Wait Times instead.
    15. In the Statistics tab, click Staytime in the statistics list to select it. Then, in the Value menu, select Average.
    16. In the General tab, clear the Show Legend checkbox.
    17. In the Y Axis Title box, type Length of Wait.
    18. In the X Axis Title box, type Simulation Time.
    19. Click the OK button to save the changes and close the window.
    20. If needed, you can adjust the display size of the charts by clicking on a chart to select it and then using its sizer boxes.

    When you're finished, your Dashboard should look like the following image:

    Step 6 - Run the Simulation and Gather Information

    Running a process flow simulation is just the same as running a simulation for a standard 3D model. You might want to make it so the dashboard and the process flow are split into two panes in the center pane. See Navigating in Process Flow for more information about how to split panes.

    1. On the simulation control bar, press the Reset button to clear any data from the process flow.
    2. Then press the Run button to watch the simulation at work.
    3. As you watch the simulation, there should only ever be one token in the Service Time activity and there should be multiple tokens waiting in Get Service activity.
    4. You'll also notice that some customers will make it to Happy Customers and some will move to Unhappy Customers. You'll notice that you'll only ever see tokens inside the Get Service activity and the Service Time activity. This is because all of the other activities perform their logic in 0 time with no created events. If you want to see a token move through each activity you can use the Step button to step a token through each of its activities.
    5. You'll notice there is a green and red circle that will appear on the Service Window resource as you run. The green icon shows how many tokens have acquired a resource. In this case we only have 1 resource available so this number will never be any higher than 1. The red icon is the number of tokens that are attempting to acquire a resource but cannot because none are available.
    6. Lastly, notice that your dashboard updates its information.

    The following image shows what the dashboard could possibly look like after running for 3,000 seconds:

    Notice that there are only slightly more happy customers than unhappy customers, which isn't a good sign. Also notice that the average wait times are very close to the maximum wait time of 200 seconds. Clearly, this is a business process that could be improved.

    If you were using the Experimenter, you could experiment by increasing the number of available service windows to determine the ideal number of employees needed at the post office.

    Step 7 - Use Labels and Decide activities to Add Complexity

    For the final step in the tutorial, you'll add some additional complexity to simulate customers who come into the post office to see how long the line for service is. If these customers see that the line for service has more than 5 people in it, they will leave without service. You will add this complexity using a Decide activity that checks a label that is dynamically assigned based on the size of the service line.

    1. First, you need to separate the activities in the first stacked block so that you can add the event-listening activity to it. Click the stacked block with the Customer Arrival activity to select it.
    2. Click the Scissors to the left of the block to separate the two activities in the block, as shown in the following image:

    3. Using your preferred method for adding an activity, add an Assign Labels activity below the Customer Arrival activity. Then add a Decide activity below the Assign Labels activity. Feel free to move the activities if you need more room in your process flow workspace.
    4. Using your preferred method for renaming an activity, change the name of the Assign Labels activity to Check Line Size. Then change the name of the Decide activity to Decide to Wait?.
    5. Create two outgoing connectors from the Decide to Wait? activity. One connector should go to the Get Service activity and the other should go to the Unhappy Customers activity. NOTE: Make sure there is also still a connector going from the Get Service activity to the Unhappy Customers activity.

    6. Now you'll edit the Check Line Size activity properties so that it will assign a dynamic label that will check the current line size. Click the Check Line Size activity to select it.
    7. In Quick Properties, click the Add button under Labels to add a new label.
    8. In the new label's Name box, delete the existing text and type lineSize.
    9. Click the arrow next to the Value box to open the picklist menu for this property. Select Get Activity Stat to open the following picklist options:

    10. Next to the Activity box, click the Sampler button to enter sampling mode. Click the Get Service activity to sample it.
    11. Next to the Stat Type box, click the Sampler button to enter sampling mode. Click the Get Service activity to open a menu of its available statistics. Select Content from the menu. Now the label will assign a value to the token based on the size of the line just before it goes to the Decide activity.

    12. Now you'll change the properties for the Decide activity. In Quick Properties, click the arrow next to the Decision box to open the picklist menu for this property. Point to Conditional Decide to open the following picklist options:

    13. In the Condition box, edit the default code so that it reads: getlabel(token, "lineSize") . This code tells it to return a value of true if the value of the lineSize label on the token is less than 5. If it is true, the token will move to the activity connected to the outgoing connector with the rank of 1 (the Get Service activity). If it is false, the token will move to the outgoing connector with a rank of 2 (the Unhappy Customers activity).
    14. Lastly, you'll check to make sure that the outgoing connectors are ranked correctly. In the Connectors Out menu, make sure that 1: is selected. The To box should say it is connected to the Get Service activity. If not, click the Up arrow next to the Rank box to change it to rank 1.

    Reset and run your model and look at the change in your statistics. How do they change the Value of Check Line Size to be 3? or 10? Feel free to experiment with adding more service windows by changing the Count on the Service Window resource.

flexsim users manualuser manuals
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

BenJoaquin Gouverneur avatar image BenJoaquin Gouverneur commented ·

This document has a typo in the Condition definition in step 13. The condition should be:

getlabel(token, "lineSize") <=5
1 Like 1 ·

Article

Contributors

paul.t contributed to this article

Navigation

FlexSim 2016.1