Internal Spreadsheets Tutorial

Internal Spread Sheets can be used to change values in your simulation without editing the simulation model itself.


This guide builds up the following example.

We have 3 different Activities and 3 different product grades. Each grade takes a different amount of time to process within each activity. The following steps show you how to set up your simulation so that these values are read in from one of Simul8’s internal spread sheets.

Step One: Create a 4-click and spread sheet

First of all we need to create a 4-click simulation model.

To create a spread sheet, first go to the Information Store dropdown, and select the Spread Sheet option;

You can now give your spread sheet a name, using the dialog shown below.

Using the naming convention ‘ss_xxx’ will make it easy to identify your spread sheet later on. This spread sheet will be used to hold timing information, so ‘ss_timing’ is an appropriate name.

Your spread sheet is now accessible from the ‘Spread Sheets’ menu on the Data & Rules tab.

Open your spread sheet, and enter the values for each Activity and Product Type. We will look at how to reference these values shortly. Your spread sheet should look like this.

It is possible to change the timing of an Activity so that it references a particular cell in a spread sheet.

In order to set this up, we use the Formula Editor; select the Activity and then use the button with 3 small dots, as below.

This takes you into the Formula Editor, where you can find your spread sheet (which we just created).

Double click on the name of your spread sheet, and it will be added to the text box as above. There is also a cell reference here, which is where you can tell your simulation which cell in the spread sheet to look at for this Activity’s timing information.

This is Activity 1, and we are only going to consider Product Type 1 at the moment, so we want to reference cell [1,1]. (it is worth noting at this point that Simul8 uses the spread sheet convention [c,r], not [r,c].

If you have a lot of values in a spread sheet and can’t remember what cell you want to reference, use the bottom left button with the small spread sheet icon; this opens up the spread sheet, and you can select the cell, click OK, and it’s [c,r] reference will be added to the text box.

Choose cell [1,1] and click OK.

Your Activity timing box should now look like this.

Whenever a work item enters the Activity, your simulation will reference the appropriate cell of ss_timing to get the timing information.

Step Three: Add more Activities

The next step is to add some more activities to your simulation model; expand your 4-click so that there are 2 more activities.

Now we can modify their timings so that they also pay attention to the relevant cell within ss_timing.

Pick Activity 2 and set it’s timing to ss_timing[2,1]. Do the same with Activity 3, and reference ss_timing[3,1].

We now have a simulation model where product type 1 takes a different amount of time in each Activity, based on the values in our spread sheet. The next step is to add the other 2 product types.

Step Four: Add more complexity; 2 more product types

We can now add two other product types, and vary the amount of time they take in each Activity, based on the values in our spread sheet.

First, create a new label (lbl_grade)* see Step by Step Guide to Labels if you are unsure.

Attach lbl_grade in your Start Point and set it so that all 3 values are equally likely (Uniform Dist, between 1 and 3). You could also use a Probability Profile at this point if you know the % of each product type.

If we look back at our spread sheet, we can see how the data is laid out.

We still want to pay attention to Column 1 in Activity 1, 2 in Activity 2 and 3 in Activity 3, but we now want to vary the Row we look at based on lbl_grade.

Instead of paying attention to row 1, we want to look at rows 2 / 3 if our lbl_grade is 2 or 3.

Change your cell reference for Activity to ss_timing[1,lbl_grade]. This means that we look at column 1, but the row we look at depends on lbl_grade. We can do the same for Activities 2 and 3, so that they look at ss_timing[2,lbl_grade] and ss_timing[3,lbl_grade] respectively.

Step Five: Test your simulation

In order to ensure our simulation is working as expected, it is important to test the way it behaves.

Use the Step control to view your simulation model event by event; when a work item arrives at Activity 1, check it’s label value using the ‘Current Contents’ button on the Properties tab.

This will give you the label value for the selected work item. Work out how long you would expect that work item to take in Activity 1 (this will be either 20, 120 or 90 minutes depending on label value).

See Also