points
¶
classes for representing points in parameter space, as well as associated hellper functions
- class ema_workbench.em_framework.points.Experiment(name, model_name, policy, scenario, experiment_id)¶
A convenience object that contains a specification of the model, policy, and scenario to run
- name¶
- Type
str
- model_name¶
- Type
str
- policy¶
- Type
Policy instance
- scenario¶
- Type
Scenario instance
- experiment_id¶
- Type
int
- class ema_workbench.em_framework.points.ExperimentReplication(scenario, policy, constants, replication=None)¶
helper class that combines scenario, policy, any constants, and replication information (seed etc) into a single dictionary.
This class represent the complete specification of parameters to run for a given experiment.
- class ema_workbench.em_framework.points.Policy(name=None, **kwargs)¶
Helper class representing a policy
- name¶
- Type
str, int, or float
- id¶
- Type
int
- all keyword arguments are wrapped into a dict.
- class ema_workbench.em_framework.points.Scenario(name=None, **kwargs)¶
Helper class representing a scenario
- name¶
- Type
str, int, or float
- id¶
- Type
int
- all keyword arguments are wrapped into a dict.
- ema_workbench.em_framework.points.combine_cases_factorial(*point_collections)¶
Combine collections of cases in a full factorial manner
- Parameters
point_collections (collection of collections of Point instances) –
- Yields
Point
- ema_workbench.em_framework.points.combine_cases_sampling(*point_collection)¶
Combine collections of cases by iterating over the longest collection while sampling with replacement from the others
- Parameters
point_collection (collection of collection of Point instances) –
- Yields
Point
- ema_workbench.em_framework.points.experiment_generator(scenarios, model_structures, policies, combine='factorial')¶
generator function which yields experiments
- Parameters
scenarios (iterable of dicts) –
model_structures (list) –
policies (list) –
{'factorial (combine =) – controls how to combine scenarios, policies, and model_structures into experiments.
sample'} – controls how to combine scenarios, policies, and model_structures into experiments.
Notes
if combine is ‘factorial’ then this generator is essentially three nested loops: for each model structure, for each policy, for each scenario, return the experiment. This means that designs should not be a generator because this will be exhausted after the running the first policy on the first model. if combine is ‘zipover’ then this generator cycles over scenarios, policies and model structures until the longest of the three collections is exhausted.