atomica.scenarios.CombinedScenario¶
- class atomica.scenarios.CombinedScenario(name=None, active=True, parsetname=None, progsetname=None, scenario_values=None, instructions=None, interpolation='linear')[source]¶
Bases:
ScenarioDefine combined (budget+program) scenario
This object stores both a set of scenario values and a set of program instructions. This allows it to simultaneously apply parameter, budget, and coverage overwrites.
As usual, parameter values from programs take precedence over parameter values from parsets, and within programs, coverage takes precedence ovetoxr budgets.
- Parameters:
name (
str) – The name of the scenario. This will also be used to name the resultactive (
bool) – If running viaProject.run_scenariosthis flags whether to run the scenarioparsetname (
str) – If running viaProject.run_scenariosthis identifies which parset to use from the projectprogsetname (
str) – If running viaProject.run_scenariosthis identifies which progset to use. If set toNonethen programs will not be usedscenario_values (
dict) – Parameter value overwrites, used as input toParameterScenarioinstructions (
ProgramInstructions) – A :class`ProgramInstructions` instance containing required program overwrites (budget, capacity, coverage)
NamedItem constructor
A name must be a string
- Parameters:
name (
str)
Attributes
Parameter scenario values (see
ParameterScenario)Interpolation method to use for parameter overwrite
Specify parset name when run via
Project.run_scenariosSpecify progset name when run via
Project.run_scenariosFlag whether the scenario should be run via
Project.run_scenariosMethods
copyGet scenario instructions
Get scenario parset
Get scenario progset
Run scenario
- active¶
Flag whether the scenario should be run via
Project.run_scenarios
- get_instructions(progset, project)[source]¶
Get scenario instructions
If the derived scenario class produces program instructions, return them here.
- Parameters:
progset (
ProgramSet) – InputProgramSet- Return type:
- Returns:
ProgramInstructionsinstance, or None if no instructions (in which case, programs will not be used)
- get_parset(parset, project)[source]¶
Get scenario parset
If the derived scenario class modifies the parset, return the modified version
- Parameters:
parset – Input
ParameterSet- Return type:
- Returns:
Modified parset for use in the simulation
- get_progset(progset, project)¶
Get scenario progset
If the derived scenario class modifies the progset, return the modified version
- Parameters:
progset (
ProgramSet) – InputProgramSet- Return type:
- Returns:
Modified progset for use in the simulation
- interpolation¶
Interpolation method to use for parameter overwrite
- parsetname¶
Specify parset name when run via
Project.run_scenarios
- progsetname¶
Specify progset name when run via
Project.run_scenarios
- run(project, parset=None, progset=None, store_results=True)¶
Run scenario
- Parameters:
project – A
Projectinstanceparset (
ParameterSet) – Optionally aParameterSetinstance, otherwise will useself.parsetnameprogset (
ProgramSet) – Optionally aProgramSetinstance, otherwise will useself.progsetnamestore_results (
bool) – If True, the results will be copied into the project
- Return type:
- Returns:
A
Resultobject
- scenario_values¶
Parameter scenario values (see
ParameterScenario)