Class: SimulationScenario

SimulationScenario(name, policyNames, yearStart, yearEnd, isCompatible)

Represent a simulation scenario that applies policies over a time period.

Constructor

new SimulationScenario(name, policyNames, yearStart, yearEnd, isCompatible)

Create a new SimulationScenario.
Parameters:
Name Type Description
name string Name of the scenario.
policyNames Array.<string> Array of policy names to apply.
yearStart number Start year of simulation.
yearEnd number End year of simulation.
isCompatible boolean Whether scenario is UI-compatible.
Source:

Methods

getIsCompatible() → {boolean}

Check if this scenario is compatible with UI editing.
Source:
Returns:
True if scenario can be edited in UI, false otherwise.
Type
boolean

getName() → {string}

Get the name of this simulation scenario.
Source:
Returns:
The scenario name.
Type
string

getPolicyNames() → {Array.<string>}

Get names of policies included in this scenario.
Source:
Returns:
Array of policy names to apply.
Type
Array.<string>

getYearEnd() → {number}

Get the end year of the simulation.
Source:
Returns:
The year the simulation ends.
Type
number

getYearStart() → {number}

Get the start year of the simulation.
Source:
Returns:
The year the simulation starts.
Type
number

toCode(spaces) → {string}

Generate the code representation of this scenario.
Parameters:
Name Type Description
spaces number Number of spaces to use for indentation.
Source:
Returns:
The code representation of the simulation scenario.
Type
string