ecoli.experiments.ecoli_engine_process
Composite for simulations with EngineProcess cells in an environment.
Note
This composite requires a config with the spatial environment enabled.
- class ecoli.experiments.ecoli_engine_process.EcoliEngineProcess(config=None)[source]
Bases:
Composer
Outer composer for use with :py:class:`~ecoli.processes.engine_process.EngineProcess.
In addition to creating an EngineProcess containing an entire vEcoli simulation, the composite generated by this composer optionally includes the
Lysis
Step when given a non-emptylysis_config
.Base class for composer classes.
Composers generate composites.
All composer classes must inherit from this class.
- Parameters:
config (dict | None) – Dictionary of configuration options that can override the class defaults.
-
defaults: Dict[str, Any]
{ 'agent_id': '0', 'divide': False, 'division_threshold': True, 'emit_paths': (), 'experiment_id': '', 'inner_composer_config': {}, 'inner_emitter': 'null', 'inner_same_timestep': True, 'lysis_config': {}, 'parallel': False, 'seed': 0, 'start_time': 0, 'stub_schemas': {}, 'tunnel_out_schemas': {}, 'tunnels_in': ()}
- class ecoli.experiments.ecoli_engine_process.EcoliInnerSim(config=None)[source]
Bases:
Composer
Inner composer to be used with :py:class:`~ecoli.processes.engine_process.EngineProcess.
Base class for composer classes.
Composers generate composites.
All composer classes must inherit from this class.
- Parameters:
config (dict | None) – Dictionary of configuration options that can override the class defaults.
-
defaults: Dict[str, Any]
{ 'agent_id': '0', 'chromosome_path': None, 'division_threshold': None, 'division_variable': None, 'initial_state': None, 'seed': 0}
- generate(config=None)[source]
Generates a complete E. coli simulation composite to be used as the inner simulation in an EngineProcess.
This requires caching the initial state generated in the course of calling
build_ecoli()
and wrapping the returned composite usingEcoliInnerWrapper
to ensure that the cached initial state is returned when theinitial_state
method is called on the composite.Additionally, this requires a special
DivisionDetector
Step to set the store located at("division_trigger",)
toTrue
when it is time to divide. This is necessary because the actual logic of division is included in thenext_update()
method of EngineProcess, making that part of the normalDivision
process obsolete but not the part that signals the time for division (whether that be via a D period or mass threshold mechanism). TheDivisionDetector
process takes over that role while relinquishing control over the actual division to EngineProcess.
- class ecoli.experiments.ecoli_engine_process.EcoliInnerWrapper(config=None, store=None, processes=None, steps=None, flow=None, topology=None, state=None)[source]
Bases:
Composite
Helper class to ensure calling initial_state() on the composite generated by EcoliInnerSim returns the cached initial state and removes the internal reference to this state.
- Parameters:
- ecoli.experiments.ecoli_engine_process.colony_save_states(engine, config)[source]
Runs the simulation while saving the states of the colony at specific timesteps to JSONs in the
data
folder. The saved files have names of the format{prefix}_seed_{seed}_colony_t{save time}.json
if a prefix is specified via thecolony_save_prefix
configuration option andseed_{seed}_colony_t{save time}.json
if not.