<< Click to Display Table of Contents >> 7. Add Entities at Specific Times |
|
Show/Hide Hidden Text |
In this run we will introduce entities into the model during the course of simulation, and take a first look at table output.
Stages of Ventity™ Modeling |
In this run, we will ... |
Stage 1 - Define entity types
|
... learn to import entity type definitions from other models and to rename entity types |
Stage 2 - Initialize the model
|
... use the initialization file "time" column to set the time at which entities appear in the simulation.
|
Stage 3 - Run the model Configure time settings and perform calculations
|
(nothing new here - just push the green button) |
Stage 4 - Examine results See model behavior in graphs and tables
|
... use tables as well as line charts to examine simulation output. |
Previously to create a new model we either created new entity types from scratch, or we made a copy an entire model. In this example, we will create a new, empty model and then import entity types from another model.
1. Create a new model named Exercise 7.
2. From the Model Menu, choose "Import>Entity Types..."
3. Browse to Exercise 6 Complete\Entity Types or click [here] and select "cow.vent". Shift-click "pasture.vent" to add it to the selection, and click "Open". This will import both the pasture entity type definition and the cow entity type definition into your new model.
Confirm in the Model Overview that entity types cow and pasture have been added to the model:
4. The "Exercise 7" entity type was created by default based on the name of the model. We don't need it, so we can delete it.
|
In this initialization we will introduce cows into the model at different times.
5. Create a built-in data set, then create a built-in data file.
6. For this exercise, we will use a single pasture.
Before continuing, verify that the model time configuration is set by default to run for about four months from the current date (the day on which you are doing this exercise). Be sure "Using Calendar Time" is selected. Use anything for the name, or leave it blank.
7. And now we have reached the point of this run: Back in the input data window, on the "cow" tab, enable several cows, and put all of them in the pasture named above. For the first one, leave "Time" equal to 0. This will cause the first cow to be present at the start of simulation. Set the Time value of each subsequent cow in one-month intervals, beginning near the Initial Calendar Time. Be sure to include the appropriate year. While you're there, be sure to assign them to the pasture you initialized.
|
8. Run the model (push the green button ).
|
. 9. To ensure our cows have arrived when they are supposed to, open the inspector for cow[] (the collection of all cows) by double-clicking in the model overveiw,
Right-click "Count" from the variables tab of the inspector, and choose "Line Chart":
You will see that four cows appear: the first one immediately at the start of simulation, and then one at the start of each subsequent month:
To this point we have been using line charts exclusively. Ventity results are also available in table or pivot table forms.
10. To view results in tables, either right-click a run in the Model Overview, and choose View Data,
or choose Model Run... from the View menu, then View Data:
A separate window will appear with a tab for each entity type. Drag column title to rearrange, or click on any column title to sort by that column.
You may also group rows in the table by dragging one or more column titles into the "group by" area at the top:
Right-clicking on any column header provides additional options for customizing table output:
Right-clicking a run in the Model Overview, and choosing "View Pivot Data Grid" instead of "View Data" gives a pivot table for grouping and summarizing data:
You may also save data to Excel or to a comma-separated text file (CSV). Each is available in horizontal or vertical formats.
In this run we caused cows to appear in the model at intermediate times during the simulation, and we looked at tables of results. In the next exercise, we will move cows among pastures by using Actions to change attribute values.
|