atomica.model.Characteristic¶
- class atomica.model.Characteristic(pop, name)[source]¶
Bases:
Variable
A characteristic represents a grouping of compartments.
Attributes
Variable code name
vals
Unique identifier for the integration object
The units for the quantity, used for plotting and for validation.
Reference back to the Population containing this object
Methods
add_denom
add_include
get_included_comps
Produce a time series plot
Preallocate data storage
relink
Make the variable a dependency
unlink
Update the value at a given time index
- id¶
Unique identifier for the integration object
- property name: str¶
Variable code name
This is implemented as a property method because the
id
of theVariable
is a tuple containing the population name and the variable code name, so this property method returns just the variable code name portion. That way, storage does not need to be duplicated.- Returns:
A code name
- plot()¶
Produce a time series plot
This is a quick function to make a basic line plot of this
Variable
. Mainly intended for debugging. Production-ready plots should be generated using the plotting library functions instead- Return type:
- pop¶
Reference back to the Population containing this object
- set_dynamic(**kwargs)[source]¶
Make the variable a dependency
For Compartments and Links, this does nothing. For Characteristics and Parameters, it will set the dynamic flag, but in addition, any validation constraints e.g. a Parameter that depends on Links cannot itself be dynamic, will be enforced.
This method generally must be overloaded in derived classes e.g.
Parameter.set_dynamic()
- units¶
The units for the quantity, used for plotting and for validation. Note that the default
'unknown'
units are distinct to dimensionless units, which have value''
- update(ti)[source]¶
Update the value at a given time index
This method performs any required computations to update the value of the variable at a given time index. For example, Parameters may require their update function to be called, while characteristics need their source compartments to be added up.
This method generally must be overloaded in derived classes e.g.
Parameter.update()
- Parameters:
ti – Time index to update