1. Run the Simulation

The default simulation configuration options are found in the leap/processed_data/config.json file. You can modify these options by creating your own config.json file and passing it to the LEAP model.

To run the LEAP model from the command line, using the default settings:

leap --run-simulation

Simulation Arguments

Flag Default Description
--config config.json Path to the config.json file. If none is provided, the default config.json will be used.
--province "BC" The province in which to run the simulation. Must be the 2-letter abbreviation for the province. One of:
  • CA: All of Canada
  • AB: Alberta
  • BC: British Columbia
  • MB: Manitoba
  • NB: New Brunswick
  • NL: Newfoundland and Labrador
  • NS: Nova Scotia
  • NT: Northwest Territories
  • NU: Nunavut
  • ON: Ontario
  • PE: Prince Edward Island
  • QC: Quebec
  • SK: Saskatchewan
  • YT: Yukon
--max-age 111 The maximum age of a person in the model. For example: --max-age 100
--min-year 2024 The year the simulation starts. For example: --min-year 2001
--time-horizon 13 The number of years to run the simulation for. For example: --time-horizon 2
--population-growth-type "LG" The population growth scenario to use. One of:
  • past: historical data
  • LG: low-growth projection
  • HG: high-growth projection
  • M1: medium-growth 1 projection
  • M2: medium-growth 2 projection
  • M3: medium-growth 3 projection
  • M4: medium-growth 4 projection
  • M5: medium-growth 5 projection
  • M6: medium-growth 6 projection
  • FA: fast-aging projection
  • SA: slow-aging projection
See StatCan. For example: --population-growth-type "M3"
--num-births-initial 100 The number of new babies born in the first year of the simulation. For example: --num-births-initial 10
--ignore-pollution False If this flag is used, the simulation will not include air pollution as a factor affecting the model.
--path-output PROVINCE-
MAX_AGE-
MIN_YEAR-
TIME_HORIZON-
POPULATION_GROWTH_TYPE-
NUM_BIRTHS_INITIAL
The name of the output directory where the results will be saved. For example: --path-output simulation1 will save the outputs to LEAP/output/simulation1.
--force False If this flag is used, then PATH_OUTPUT will be used as the destination folder without prompting for confirmation, overwriting any existing data located there.
--verbose False If this flag is used, the simulation will print out more information about the simulation as it runs. This is useful for debugging purposes.

Examples

To run the simulation for 1 year, starting in 2024, with the maximum age of 4, and 10 new borns in the first year:

leap --run-simulation --time-horizon 1 --num-births-initial 10 --max-age 4 --min-year 2024 --path-output PATH/TO/OUTPUT

To specify the province and population growth scenario:

leap --run-simulation --time-horizon 1 --num-births-initial 10 --max-age 4 --province "CA" --min-year 2024 --population-growth-type "M3" --path-output PATH/TO/OUTPUT

If you would like to use your own config.json file instead of the default one:

leap --run-simulation --config PATH/TO/YOUR/CONFIG.json