NutMEG.culture.horde package¶
Submodules¶
NutMEG.culture.horde.horde module¶
-
class
NutMEG.culture.horde.horde.
horde
(name, locale, metabolism, num, maintenance=None, CHNOPS=None, mass=1e-15, dry_mass=3e-16, *args, **kwargs)¶ Bases:
NutMEG.culture.base_organism.base_organism.base_organism
Class for a horde of organisms acting as one for better efficiency., albeit losing some fidelity. For the majority of applications using a horde is much better than using a colony. A horde shares most attributes with base-organism like objects (and using them as per-cell parameters), but has a couple of its own.
-
num
¶ The number of organisms the horde represents.
- Type
int
-
volume
¶ The total volume of the horde.
- Type
float
-
deathnum
¶ The number of dead cells which are inactive, but still represent biomass.
- Type
int
-
biomass_cell_ratio
¶ To be used for conversion between cell numbers and volumes, because some cells will be mid growth and bigger than others. Default 1.5.
- Type
float, kwarg
-
get_mass
(inactive=False)¶ return the total (approximate) biomass of the horde in kg
-
get_population
(inactive=False)¶ Return total number of cells in the horde
-
get_volume
(inactive=False)¶ return the total volume of the horde in m^3
-
reproduce
()¶ Hordes don’t reproduce, throw an error if something tries to make it do so.
-
select_timestep
(factorup=1.01, returncop=False)¶ work out a suitable time step for the horde to grow by factorup times. return the timestep. If returncop is passed as True, also return the copy used to calculate the timestep.
-
take_step
(t)¶ Overwrite base_organisms take_step. Send the horde forward by time t. Perform all metabolic reactions and grow the horde if possible.
-
update_num
(t)¶ After updating the volume, correct the number of organisms.
-
workoutID
()¶
-
NutMEG.culture.horde.horde_output module¶
-
class
NutMEG.culture.horde.horde_output.
horde_output
(hosthorde)¶ Bases:
object
helper class for managing the output of a horde, either to terminal or to a database.
-
params
¶ Dictionary of parameters to output.
- Type
dict
-
appendvals
(startnum, dt)¶ Add parameters at the present time to params.
- Parameters
startnum (int) – Previous number of organisms, assuming this is output after a time step. Used to calculate thr gorwth rate
dt (float) – Amount of time that has passed since the previous step.
-
buildbaseparams
()¶
-
params
= {}¶
-
paramtypelst
()¶
-
refreshparams
()¶ reset the parameter dictionary to have empty numpy arrays.
Inherit and adjust this method for saved organisms which have specific parameters you want to monitor.
-