Class BubbleTool¶
template <typename TSeq>
Tool carried by every agent under aBubbles policy.More...
#include <bubbles-bones.hpp>
Inherits the following classes: Tool
Public Functions¶
| Type | Name |
|---|---|
| BubbleTool (std::string name, std::string event_name) |
|
| virtual std::unique_ptr< Tool< TSeq > > | clone_ptr () override const |
| virtual epiworld_double | get_susceptibility_reduction (VirusPtr< TSeq > & v, Model< TSeq > * model) override Reduction applied to an exposure of this tool's agent. |
Public Functions inherited from Tool¶
See Tool
| Type | Name |
|---|---|
| EPI_TYPENAME_TRAITS (TSeq, int) |
|
| Tool () |
|
| Tool (std::string name="unknown tool") |
|
| Tool (std::string name, epiworld_double prevalence, bool as_proportion) |
|
| void | add_target (int lineage_id) |
| void | add_target (const Virus< TSeq > & v) |
| void | clear_targets () |
| virtual std::unique_ptr< Tool< TSeq > > | clone_ptr () const |
| void | distribute (Model< TSeq > * model) |
| Agent< TSeq > * | get_agent () |
| int | get_date () const |
| virtual epiworld_double | get_death_reduction (VirusPtr< TSeq > & v, Model< TSeq > * model) |
| int | get_id () const |
| virtual std::string | get_name () const |
| void | get_queue (epiworld_fast_int * init, epiworld_fast_int * post) |
| virtual epiworld_double | get_recovery_enhancer (VirusPtr< TSeq > & v, Model< TSeq > * model) |
| void | get_state (epiworld_fast_int * init, epiworld_fast_int * post) |
| virtual epiworld_double | get_susceptibility_reduction (VirusPtr< TSeq > & v, Model< TSeq > * model) |
| std::vector< int > | get_targets () const Empty if the tool acts on every virus. |
| virtual epiworld_double | get_transmission_reduction (VirusPtr< TSeq > & v, Model< TSeq > * model) |
| bool | operator!= (const Tool< TSeq > & other) const |
| bool | operator== (const Tool< TSeq > & other) const |
| bool | operator== (const Tool< std::vector< int > > & other) const |
| bool | operator== (const Tool< std::vector< int > > & other) const |
| void | print () const |
| void | set_date (int d) |
| virtual void | set_death_reduction (std::string param) |
| virtual void | set_death_reduction (epiworld_double * prob) = delete |
| virtual void | set_death_reduction (epiworld_double prob) |
| virtual void | set_death_reduction_fun (ToolFun< TSeq > fun) |
| void | set_distribution (ToolToAgentFun< TSeq > fun) |
| void | set_id (int id) |
| void | set_name (std::string name) |
| void | set_queue (epiworld_fast_int init, epiworld_fast_int post) |
| virtual void | set_recovery_enhancer (std::string param) |
| virtual void | set_recovery_enhancer (epiworld_double * prob) = delete |
| virtual void | set_recovery_enhancer (epiworld_double prob) |
| virtual void | set_recovery_enhancer_fun (ToolFun< TSeq > fun) |
| void | set_sequence (TSeq d) |
| void | set_sequence (std::shared_ptr< TSeq > d) |
| void | set_sequence (int d) |
| void | set_sequence (int d) |
| void | set_state (epiworld_fast_int init, epiworld_fast_int post) |
| virtual void | set_susceptibility_reduction (std::string param) |
| virtual void | set_susceptibility_reduction (epiworld_double * prob) = delete |
| virtual void | set_susceptibility_reduction (epiworld_double prob) |
| virtual void | set_susceptibility_reduction_fun (ToolFun< TSeq > fun) |
| void | set_targets (const std::vector< int > & lineage_ids) |
| virtual void | set_transmission_reduction (std::string param) |
| virtual void | set_transmission_reduction (epiworld_double * prob) = delete |
| virtual void | set_transmission_reduction (epiworld_double prob) |
| virtual void | set_transmission_reduction_fun (ToolFun< TSeq > fun) |
| bool | targets (const Virus< TSeq > & v) const |
| virtual | ~Tool () = default |
Protected Attributes inherited from Tool¶
See Tool
| Type | Name |
|---|---|
| Agent< TSeq > * | agent = nullptr |
| int | date = -99 |
| ToolFun< TSeq > | death_reduction = nullptr |
| ToolToAgentFun< TSeq > | dist = nullptr |
| int | id = -99 |
| int | pos_in_agent = -99Location in the agent. |
| epiworld_fast_int | queue_init = [**Queue**](classQueue.md)<TSeq>::NoOneChange of state when added to agent. |
| epiworld_fast_int | queue_post = [**Queue**](classQueue.md)<TSeq>::NoOneChange of state when removed from agent. |
| ToolFun< TSeq > | recovery_enhancer = nullptr |
| epiworld_fast_int | state_init = -99 |
| epiworld_fast_int | state_post = -99 |
| ToolFun< TSeq > | susceptibility_reduction = nullptr |
| uint64_t | target_mask = ~uint64\_t(0)Bitmask of targeted virus lineages (all ones: every virus). |
| std::string | tool_name |
| ToolFun< TSeq > | transmission_reduction = nullptr |
Protected Functions inherited from Tool¶
See Tool
| Type | Name |
|---|---|
| EPI_TYPENAME_TRAITS (TSeq, int) Sequence of the tool. |
|
| void | set_agent (Agent< TSeq > * p, size_t idx) |
Protected Static Functions inherited from Tool¶
See Tool
| Type | Name |
|---|---|
| uint64_t | target_bit (int lineage_id) Throws for ids out of range. |
Detailed Description¶
The tool does not hold the bubble partition it holds a pointer to the Bubbles intervention that owns it, resolved by name from the model the first time the tool is used. clone_ptr() clears that pointer, exactly as ToolVaccine clears its per-agent immunity, so a copy of the tool always re-resolves against the model it ends up in. Copies of a model therefore never reach into the model they were copied from, which is what lets bubble models run in parallel replicates.
Users do not instantiate this directly; the intervention hands it to every agent when it sets itself up, at the start of each run.
Template parameters:
TSeqSequence type (should matchTSeqacross the model).
Public Functions Documentation¶
function BubbleTool¶
function clone_ptr¶
Implements Tool::clone_ptr
function get_susceptibility_reduction¶
Reduction applied to an exposure of this tool's agent.
inline virtual epiworld_double BubbleTool::get_susceptibility_reduction (
VirusPtr < TSeq > & v,
Model < TSeq > * model
) override
0.0 when the transmitter shares the agent's bubble (contacts inside the bubble are what the policy preserves), and 1 - f otherwise, where f is the intervention's transmission factor. Outside the policy window, or before a partition exists, the reduction is 0.0.
Implements Tool::get_susceptibility_reduction
The documentation for this class was generated from the following file include/epiworld/globalevents/bubbles-bones.hpp