Skip to content

Commit

Permalink
clean up math typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiragKumar9 committed Oct 17, 2024
1 parent 6206f1f commit 1f2ceb3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions examples/time-varying-infection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,14 @@ the number of infected people changes, we need to recalculate the expected
recovery time. Alternatively, instead of subscribing the simulation to
a change in the number of infected people, we could schedule events to occur
at the maximum rate of change in the number of infected people. This rate
is the maximum of the absolute value of either the infection rate or the recovery
rate. The maximum recovery rate is equal to recovery rate scaling factor (i.e.,
the factor that makes $n(t)$ an _effective_ number of infected people) because
this is the theoretically fastest recovery rate (1 person is infected), and the
is the maximum recovery rate over the maximum infection rate. The maximum
recovery rate is equal to recovery rate scaling factor (i.e., the factor
that makes $n(t)$ an _effective_ number of infected people) because this
is the theoretically fastest recovery rate (1 person is infected), and the
maximum of the infection rate is 2 ($sin(t + c)$ has maximum range of 1,
and foi$(t) = sin(t + c) + 1$). Let us assume that the recovery rate is less than 1
(as would be expected for a food-borne illness), so we must schedule rejection sampling
events to happen at a time of 1/2 days.
and foi$(t) = sin(t + c) + 1$). Let us call the recovery rate scaling factor
$\gamma$, so we must schedule rejection sampling events to happen at a rate of
$\gamma/(1/2) = 2\gamma$.

### Implementation

Expand Down Expand Up @@ -329,8 +329,9 @@ fn evaluate_recovery(context: &mut Context, person_id: usize) {
// recovery has happened by now
context.set_person_property(person_id, InfectionStatus, InfectionStatus::R);
} else {
// add plan for recovery to happen again at fastest rate
context.add_plan(context.get_time() + 0.5, move |context| {
// add plan for recovery evaluation to happen again at fastest rate
context.add_plan(context.get_time() + context.sample_distr(ExposureRng, Exp::new(2 * parameters.gamma).unwrap()),
move |context| {
evaluate_recovery();
});
}
Expand Down

0 comments on commit 1f2ceb3

Please sign in to comment.