Observers

An observer is a component that is responsible for registering observations to the simulation.

The provided Observer class is an abstract base class that should be subclassed by concrete observers. Each concrete observer is required to implement a register_observations method that registers all required observations.

class vivarium.framework.results.observer.Observer[source]

An abstract base class intended to be subclassed by observer components.

Notes

A register_observation method must be defined in the subclass.

property configuration_defaults: dict[str, Any]

The dictionary containing the defaults for any configurations managed by this component.

These default values will be stored at the component_configs layer of the simulation’s LayeredConfigTree.

get_configuration_name()[source]

Returns the name of a concrete observer for use in the configuration

Return type:

str

get_configuration(builder)[source]

Retrieves the configuration for this component from the builder.

This method retrieves the configuration for this component from the simulation’s overall configuration. The configuration is retrieved using the name of the component as the key.

Return type:

LayeredConfigTree

Parameters:

builder (Builder) – The simulation’s builder object.

Returns:

The configuration for this component, or a default empty configuration.

abstractmethod register_observations(builder)[source]

Registers observations with within each observer.

Return type:

None

Parameters:

builder (Builder)

setup_component(builder)[source]

Sets up the observer component.

Return type:

None

Parameters:

builder (Builder)

set_results_dir(builder)[source]

Defines the results directory from the configuration.

Return type:

None

Parameters:

builder (Builder)