concentration_limit method not public anymore; providing a docstring
This commit is contained in:
parent
236a7139f5
commit
717390377e
2 changed files with 9 additions and 4 deletions
|
|
@ -647,7 +647,13 @@ class ConcentrationModel:
|
|||
self.room, self._next_state_change(time))
|
||||
|
||||
@cached()
|
||||
def concentration_limit(self, time: float) -> _VectorisedFloat:
|
||||
def _concentration_limit(self, time: float) -> _VectorisedFloat:
|
||||
"""
|
||||
Provides a constant that represents the theoretical asymptotic
|
||||
value reached by the concentration when time goes to infinity.
|
||||
It's a piecewise constant function - at any time it takes the
|
||||
value it would have at the end of the current interval.
|
||||
"""
|
||||
V = self.room.volume
|
||||
IVRR = self.infectious_virus_removal_rate(time)
|
||||
|
||||
|
|
@ -700,8 +706,7 @@ class ConcentrationModel:
|
|||
|
||||
delta_time = time - t_last_state_change
|
||||
fac = np.exp(-IVRR * delta_time)
|
||||
concentration_limit = self.concentration_limit(time)
|
||||
return concentration_limit * (1 - fac) + concentration_at_last_state_change * fac
|
||||
return self._concentration_limit(time) * (1 - fac) + concentration_at_last_state_change * fac
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ def test_concentration_model_constant_parameters():
|
|||
)
|
||||
)
|
||||
times = [0.1, 10, 20, 24]
|
||||
concentration_limits = np.array([c_model.concentration_limit(t)
|
||||
concentration_limits = np.array([c_model._concentration_limit(t)
|
||||
for t in times])
|
||||
IVRRs = np.array([c_model.infectious_virus_removal_rate(t)
|
||||
for t in times])
|
||||
|
|
|
|||
Loading…
Reference in a new issue