The UFZ services GitLab and Mattermost will be unavailable on Monday, July 4 from 06:00 AM to 08:00 AM due to maintenance work.

Commit 59d92cd6 authored by Adam Reichold's avatar Adam Reichold
Browse files

Make tracing the temporal network optional as it has a significant computational cost.

parent a9b0ab26
Pipeline #54753 passed with stage
in 6 minutes and 9 seconds
......@@ -32,6 +32,7 @@ pub struct Params {
pub bumblebees: Box<[Bumblebee]>,
pub transect: Box<Transect>,
pub init: Box<Init>,
pub trace_temporal_network: bool,
}
\end{code}
......@@ -312,6 +313,7 @@ The parameters of the random walk used to model insect flight are based on \auto
bumblebees: vec![bumblebee].into(),
transect: Default::default(),
init: Default::default(),
trace_temporal_network: false,
}
}
}
......
......@@ -120,19 +120,22 @@ pub fn infection_contamination(
The \inlinecode{flower_contaminators} hash table is used to track which individuals have contaminated a given flower within a patch. This is used to derive a temporal network for these epidemiologically relevant contacts by collecting the edges between contaminator and visitor. This tracking is tied to contamination events instead of infection events or just visits as the decontamination time provides the relevant time scale for the temporal network.
\begin{code}
let flower_contaminators = flower_contaminators.entry((index, flower)).or_default();
if params.trace_temporal_network {
let flower_contaminators = flower_contaminators.entry((index, flower)).or_default();
flower_contaminators.retain(|(contaminator, decontaminates_at)| {
if *decontaminates_at > tick {
temporal_network.push((tick, *contaminator, id));
flower_contaminators.retain(|(contaminator, decontaminates_at)| {
if *decontaminates_at > tick {
temporal_network.push((tick, *contaminator, id));
true
} else {
false
}
});
true
} else {
false
}
});
*dictionary(flower_contaminators, id) = tick + flower_patch_params.decontamination(params, rng);
*dictionary(flower_contaminators, id) =
tick + flower_patch_params.decontamination(params, rng);
}
let is_susceptible = matches!(status, Status::Susceptible);
let is_infected = status.is_infected();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment