atomica.model.SinkCompartment¶
- class atomica.model.SinkCompartment(pop, name)[source]¶
Bases:
atomica.model.Compartment
Attributes
Variable code name
Return the outflow at all times
Methods
Construct link out of sink compartment
expected_duration
expected_outflow
Produce a time series plot
Preallocate sink compartment
relink
Resolve sink outflows
Make the variable a dependency
unlink
Update sink compartment value
- connect(dest, par)[source]¶
Construct link out of sink compartment
This method raises an error because sinks cannot have outflows
- Parameters
dest – A
Compartment
instancepar – The parameter that the Link will be associated with
- Return type
- 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.- Return type
- Returns
A code name
- property outflow: numpy.array¶
Return the outflow at all times
- Return type
array
- Returns
The sum of outgoing links at all time indices
- 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
- preallocate(tvec, dt)[source]¶
Preallocate sink compartment
A sink compartment is initialized with 0.0 value at the initial timestep
- resolve_outflows(ti)[source]¶
Resolve sink outflows
There should not be any outflows, so this function immediately returns
- Return type
- set_dynamic(**kwargs)¶
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()
- Return type
- 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''