vivarium.core.process module

Process and Compartment Classes

class vivarium.core.process.Deriver(parameters=None)[source]

Bases: vivarium.core.process.Process

is_deriver()[source]
class vivarium.core.process.Generator(config)[source]

Bases: object

Generator parent class

All compartment classes must inherit from this class.

defaults = {}
generate(config=None, path=())[source]

Generate processes and topology dictionaries for the compartment

Parameters
  • config (dict) – Updates values in the configuration declared in the constructor

  • path (tuple) – Tuple with (‘path’, ‘to’, ‘level’) associates the processes and topology at this level

Returns

Dictionary with two keys: processes, which has a value of a processes dictionary, and topology, which has a value of a topology dictionary. Both are suitable to be passed to the constructor for vivarium.core.experiment.Experiment.

Return type

dict

generate_processes(config)[source]

Generate processes dictionary

Every subclass must override this method.

Parameters

config (dict) – A dictionary of configuration options. All subclass implementation must accept this parameter, but some may ignore it.

Returns

Subclass implementations must return a dictionary mapping process names to instantiated and configured process objects.

Return type

dict

generate_topology(config)[source]

Generate topology dictionary

Every subclass must override this method.

Parameters

config (dict) – A dictionary of configuration options. All subclass implementation must accept this parameter, but some may ignore it.

Returns

Subclass implementations must return a topology dictionary.

Return type

dict

get_parameters()[source]
or_default(parameters, key)[source]
class vivarium.core.process.ParallelProcess(process)[source]

Bases: object

end()[source]
get()[source]
update(interval, states)[source]
class vivarium.core.process.Process(parameters=None)[source]

Bases: vivarium.core.process.Generator

default_state()[source]
defaults = {}
derive_defaults(original_key, derived_key, f)[source]
derivers()[source]
generate_processes(config)[source]
generate_topology(config)[source]
get_schema(override=None)[source]
is_deriver()[source]
local_timestep()[source]

Returns the favored timestep for this process. Meant to be overridden in subclasses, unless 1.0 is a happy value.

merge_overrides(override)[source]
next_update(timestep, states)[source]

Find the next update given the current states this process cares about. This is the main function a new process would override.

or_default(parameters, key)[source]
ports()[source]
ports_schema()[source]

ports_schema returns a dictionary that declares which states are expected by the processes, and how each state will behave.

state keys can be assigned properties through schema_keys declared in Store:

‘_default’ ‘_updater’ ‘_divider’ ‘_value’ ‘_properties’ ‘_emit’ ‘_serializer’

pull_data()[source]
vivarium.core.process.assoc_in(d, path, value)[source]
vivarium.core.process.generate_derivers(processes, topology)[source]
vivarium.core.process.override_schemas(overrides, processes)[source]
vivarium.core.process.run_update(connection, process)[source]
vivarium.core.process.serialize_dictionary(d)[source]
vivarium.core.process.serialize_list(lst)[source]
vivarium.core.process.serialize_value(value)[source]