Task 4.1 - Experiment Job

Task Overview

In this tutorial, you'll use an Experiment Job to specify several scenarios, and run many replications of those scenarios.

For this tutorial, let us examine a very simple situation. A single worker must carry an item from a source to a processor. After the item finishes processing, the worker must carry it to a second processor that takes longer than the first. After the the second processor finishes the item, the worker then carries it to the sink.

Now we want to see if we can maximize the throughput of this system by adjusting (which is also tied to revenue) the position of the processors. If each processor could be moved up to three meters right or left, where should each be placed? It would be very difficult to intuitively know how to place both processors to maximize throughput. In order to solve this problem accurately, we will use the Experimenter and Optimizer.

Obviously this is a drastically simplified scenario, but often in real life you have situations where you want to see how various layouts affect overall throughput. This is a very simplistic implementation of such an experiment.

Step 1 Build the 3D Model

In this step, you'll build a basic 3D model for this tutorial. When you're finished, your model should look similar to the following image:

To build this model:

  1. Make sure your 3D model window is open and active. From the Library, drag the following 3D objects into the model:
    • A Source
    • A Processor
    • A Processor
    • A Sink
    • A Dispatcher
    • An Operator
  2. Click on Source1
  3. Click on the Position button in the Properties and set the position reference to Direct Spatials.
  4. Set the location of the objects according to the table below:
    Object X Position Y Position
    Source1 0.0 0.0
    Processor1 10.0 0.0
    Processor2 20.0 0.0
    Sink1 30.0 0.0
    Dispatcher1 N/A N/A
    Operator2 N/A N/A
    Dispatcher5 and Operator7 do not need to be in a particular place, but they should not be in line with the rest of the objects.
  5. Set the following logic:
    • Set Source1, Processor1, and Processor2 to Use Transport.
    • Set the process time of Processor1 to normal(10, 2, getstream(current)).
    • Set the process time of Processor2 to normal(12, 3, getstream(current)).

Check to ensure your model looks similar to the image shown at the beginning of this step.

Step 2 Creating Parameters

To create parameters, you'll use a Model Parameters Table. Then you'll configure two parameters. Each parameter will be linked to a Processor. On reset, the processor will move so that it's x-location matches the value of the Parameter.

    • In the Toolbox, double click on the Model Parameter Table called Parameters to open it.
    • Click and drag the Parameter Table view to dock it to the right of the 3D view.
    • Click on the Value cell of Parameter1. A button will appear. Click this button to open the parameter value properties.
    • Set the Lower Bound to 7
    • Set the Upper Bound to 13
    • Click the sampler button next to the Reference field.
    • Click on Processor1, point to Properties and then choose SetupTime.
    • Click the properties button next to the On Set field.
    • Change Property to Location.X.
    • Click on the parameter value properties to close the popup.

    • At the top of the Parameters table, click the up button to add another parameter.
    • Click on the Value cell for Parameter1 to select it.
    • Press Ctrl-C to copy the value
    • Click on the Value cell for Parameter2 to select it.
    • Press Ctrl-V to paste the value.
    • Click the button to open the parameter value properties for Parameter2.
    • Set the Lower Bound to 17
    • Set the Upper Bound to 23
    • Click the sampler button next to the Reference field.
    • Click on Processor2, and choose Processor2.

To see how these parameters work, reset the model. Processor1 should move so it's x-location is 7, and Processor2 should move so it's x-location is 17. Edit the parameter table, and put in new values for Parameter1 and Parameter2, such as 10 and 20. When you reset the model again, the processors should move to match.

Step 3 Creating Performance Measures

In the toolbox, double click the Performance Measure Table called PerformanceMeasures. Dock it in the same pane as the Parameters table view. From there:

  1. Click the Value cell for PerformanceMeasure1.
  2. Click the button to open the peformance measure value properties.
  3. Click the Sampler button .
  4. Click on Sink1 to sample it. Then point to Statistics and choose Input.
  5. Click outside the performance measure value properties window to close it.

Now, if you run the model long enough, you should be able watch the performance measure's value increase as boxes enter the sink.

Step 4 Designing the Experiment Job

Now that we've created the parameters and performance measures, we'll set up an Experiment Job to run replications of some scenarios.

  1. In the Statistics menu, choose Experimenter. The experimenter window will appear. It should already contain an Experiment Job called Experiment1.
  2. Check the box in the Parameters list. This will add all the parameters in the Parameters table to the experiment.
  3. Create 5 total scenarios by entering a 5 in the scenario count field.
  4. Enter scenario names and values as follows:

Step 5 Running the Experiment Job

Go to the Run tab. Click the Run button. Each scenario will be run 5 times and the results of the performance measure will be collected at the end of each run. The status chart will show which scenarios/replications are currently being run. FlexSim will run multiple scenarios simultaneously if your computer has a multi-core cpu.

Once the experiment is finished, click the button at the top. This will open a window where you can get data on the performance measures for the scenario. In this example we only have one performance measure, but if you had multiple you could see the results for each in this window. There are several options for how to display the data, including a Replications Plot, a Frequency Histogram, a Correlation Plot (for examining correlations between multiple performance measures), a Data Summary, and a Raw Data view.

If the goal is to maximize throughput, then the "Close" scenario is the best option.

Conclusion

At this point, you've learned how to use an Experiment Job. In the next tutorial task, you'll learn how to use an Optimization Job. Continue on to Tutorial Task 4.2 - Optimization Job.