User Tools

Site Tools


trainingtutorial:tutorial_1:chapter1

Chapter1 - Building the Structure

This shows a screen shot of what the model will look like after we have built all the structure. The picture on the left is the hierarchy view and on the right is the population calculator. This is for reference as you build the model:

{{:trainingtutorial:tutorial1:tutorial1.jpg|}}

Create Model

Setup Informants

Informants are the sets and elements that are used to classify the data in the variables. They are used as the dimensions on the variables.

Here we learn how to create informants and make the ones necessary for this tutorial, however, they don't have to all be made ahead of time. They can be added as they are thought of or needed.

1. Add Informant gender with the following properties:

  • Description: gender
  • Modelbase Name: gender
  • Index: g
  • Type: set
  • Elements: male, female

2. Add Informant

  • Description: simulation time
  • Modelbase Name: time
  • Index: t
  • Type: sequence
  • Start: 1992
  • End: 2042
  • Step: 1
  • Interval: year

3. Copy Informant - Select time, right click copy and paste. The new informant will be called time1, double click on it and adjust it so it has these properties:

  • Description: base year
  • Modelbase Name: time (yes same as in for #2!)
  • Index: byr
  • Type: sequence
  • Start: 1991
  • End: 1991
  • Step: 1
  • Interval: year

4. Add Informant

  • Description: age
  • Modelbase Name: age
  • Index: a
  • Type: sequence
  • Start: 0
  • End: 90
  • Step: 1
  • Interval: year

5. Copy Informant - Select age, right click copy and paste. The new informant will be called age1, double click on it and adjust it so it has these properties:

  • Description: mothers age
  • Modelbase Name: age (yes same as in for #4!)
  • Index: ma
  • Type: sequence
  • Start: 15
  • End: 50
  • Step: 1
  • Interval: year

Add Calculators

From the main hierarchy diagram we will add a new yellow box as the 1st and only calculator in this model.

1. Add a Calculator with the following info:

  • Description: Population
  • Modelbase Name: population

2. Make connections Connect the root node to the newly created calculator.

Add Variables

Inside the population calculator (double click it from the hierarchy diagram window or the tree view on the left side) we need to add the variables that will be a part of our cohort calculation. Use the image at the beginning to get an idea of where to put the variables as you create them.

Add Inputs

1. Add a Variable base population - is the starting population (population in the base year) for the simulation.

  • Type: Stock
  • Description: base population
  • Modelbase Name: basePop
  • Object Type: Array (default)
  • Fixed: no (default)
  • Informants: (dimensions): gender (g), “base year” time (byr), age (a)
  • Data Type: Real (default)
  • Data Precision: single (default)
  • Units: person
  • History - Skip because this is not calibrated
  • Notes - skip

2. Add a Variable mortality - The mortality variable is the probability of death. Fields that should stay as default are left out:

  • Type: Parameter
  • Description: mortality
  • Modelbase Name: mortality
  • Informants: (dimensions): gender (g), time (t), age (a)
  • Units: /year (year is in the denominator)

3. Add a Variable total period fertility - is the total (sum over all ages) birth propensity. Fields that should stay as default are left out:

  • Type: Parameter
  • Description: total period fertility
  • Modelbase Name: totPeriodFert
  • Informants: (dimensions): time (t)
  • Units: /year (year is in the denominator)

4. Add a Variable fertility share - is the share of births at any time by mothers age (15 to 50 years of age).. Fields that should stay as default are left out:

  • Type: Parameter
  • Description: fertility share
  • Modelbase Name: fertShr
  • Informants: (dimensions): time (t), “mothers age” age (ma)
  • Units: none

5. Add a Variable gender share - share is the fraction of births at time t that are male. Fields that should stay as default are left out:

  • Type: Parameter
  • Description: gender share
  • Modelbase Name: genderShr
  • Informants: (dimensions): time (t)
  • Units: none

6. Add a Variable net immigration - immigration is the net flow of people into the population from(to) external sources(sinks). Fields that should stay as default are left out:

  • Type: Flow
  • Description: net immigration
  • Modelbase Name: netImmgr
  • Informants: (dimensions): gender (g), time (t), age (a)
  • Units: person / year

Add Procedure

Procedures are where the “math” occurs. Procedures have TOOL code in them that process the inputs appropriately to produce the outputs. For now we will create an empty procedure and hook it up.

1. Add a Procedure with the description set to “Evolve Population”

2. Make connections Connect all the inputs to the new procedure.

Add Output

1. Add a Variable population - The mortality variable is the probability of death. Fields that should stay as default are left out:

  • Type: Stock
  • Description: population
  • Modelbase Name: population
  • Informants: (dimensions): gender (g), time (t), age (a)
  • Units: person

2. Make connections Connect the procedure to the outputs

Save Model

1. Select File > Save to save the model. (This should be done frequently while working on the model.)

Next Step

trainingtutorial/tutorial_1/chapter1.txt · Last modified: 2012/03/01 16:51 by deryn.crockett