<< Click to Display Table of Contents >> 3. Replicate Entities |
|
Show/Hide Hidden Text |
In this third run of the Pasture model, you will convert your model of one pasture into a model of any number of pastures, as easily as adding and selecting lines to the initialization Input Data file.
A video of this exercise and the previous is available:
Stages of Ventity™ Modeling |
In this run, we will ... |
Stage 1 - Define entity types
|
(no changes from previous run)
|
Stage 2 - Initialize the model
|
We will see how to add pastures to the model simply by adding lines to the input data.
|
Stage 3 - Run the model Configure time settings and perform calculations
|
(no changes from previous run)
|
Stage 4 - Examine results See model behavior in graphs and tables
|
We will use the scenario entity overview to add or remove pastures from the line graph. |
As before, you can pick up where you left off at the end of Exercise 2, or you can open the Exercise 2 Complete model from the [here], choose "Save As..." from the File Menu, and save the model as Exercise 3.
Our design of a pasture entity from Exercise 1 is still all we need, so this stage is complete.
|
The purpose of initialization is to specify how many of each type of entity are in the model, and to set their individual characteristics. We will do this by creating a new built-in Input Data file. In that file, will add a row for each pasture entity we wish to create, and fill in the individual characteristics by column.
1. Expand Entity Initialization Data and right-click the data set "Input 1" and select "Add builtin data".
2. Under the Data Sources folder, right-click and choose Rename to change the name of the builtin from "Entities 1" to "many pastures".
3. In the built-in data file editor, click on the row with an asterisk (*) to add a new row to the table. Add several rows to create several pasture entities. Give each one a unique name in the pastureID column, and its own initial Grass Height value in the Grass Height column. You can drag the column borders to create space for longer names. The "Enabled" column lets you easily include or exclude pastures from the run.
Now instead of one pasture, your model run will have as many as you've entered and enabled. The figure above will create five pastures with initial grass heights ranging from 8 to 12 cm.
4. Before running the model, ensure "many pastures" is active by left clicking the icon besides the builtin data from to , signifying it's enabled. We'll be using the "active" Data Set to run, which will run any of the runs with that are in the active Data Set or Data Sources folders.
|
No changes are desired in the time configuration, so we just need to choose a name for the run. This time we'll use the top toolbar name field only. However, your Run Control might still have entries from previous activity. Open Run Control by double-clicking it in the Model Overview, or right-clicking and choosing "Edit". We need to make two changes.
5. Ensure that the Name column is empty.
6. Click anywhere in the second row to select the row. You'll see it is selected from the small black arrow on the left ( , item 1 in the figure). Then, click the "delete row" button ( , item 2) to remove the row.
7. Change the "Data Sets" column to read "Use active dataset", by clicking the cell and selecting the "Use active dataset" checkbox:
We can now name and run the simulation. We could use a descriptive name like "more pastures" but instead let's enter a generic name like "Run 001".
Also, note the "Overwrite" box. As long as the Overwrite box is checked, each new run will use the same name, replacing any previous run by that name in memory. If it is not checked, Ventity will add a number to the run name to prevent duplicates. Now, simply run the model using the run button or Run Model from the Model menu.
|
5. Just as in the previous run, you can right-click Grass Height and choose Line Chart to show results.
6. For a legend, right-click on the chart and choose "Show Legend" (or uncheck "Show Legend" to remove it), ...
7. ... or Drill down to entities:
8. And, again as in the previous run, you can use the Scenario Entity Overview to select or deselect entities--or runs, if you have more than one run available--to be included in the chart:
As you can see, going from having one pasture in the model, to twelve, to 150 is simply a matter of whether there are one or twelve or 150 rows in the input data file. Once the data are entered, you can easily include or exclude entities just by checking a box.
As you walk through the next models, you will learn how to represent interactions among the entities in a model.
|