Skip to content

experiment.runner

Runner for SimulationExperiments.

The ExperimentRunner is used to execute simulation experiments. This includes - loading of datasets - loading of models - running tasks (simulation on models) - creating outputs

ExperimentRunner

ExperimentRunner(
    experiment_classes,
    base_path,
    data_path,
    simulator=None,
    ureg=None,
    **kwargs,
)

Class for running simulation experiments.

Initialize the runner.

FIXME: document arguments for the solver.

set_simulator

set_simulator(simulator)

Set simulator on the runner and experiments.

initialize

initialize(experiment_classes, **kwargs)

Initialize ExperimentRunner.

Initialization is required in addition to construction to allow serialization of information for parallelization.

run_experiments

run_experiments(
    output_path,
    show_figures=False,
    save_results=False,
    figure_formats=None,
    reduced_selections=True,
)

Run the experiments.

model_key

model_key(abstract_model)

Get the key a loaded model is cached under.

Two experiments share a loaded model when they name the same source, the same language and the same changes; the changes are part of it because they are applied to the roadrunner instance when it is created. The key is the description of the model and not the object: an experiment builds its own AbstractModel, which has no equality of its own, so caching on the object would never find anything and every experiment would load and compile the model again.

Parameters:

Name Type Description Default
abstract_model AbstractModel

the model of an experiment.

required

Returns:

Type Description
ModelKey

The key, hashable and equal for two descriptions of the same model.

run_experiments

run_experiments(
    experiments, output_path, base_path=None, data_path=None
)

Run simulation experiments and write their report to the output path.