BaseTreatment#

class BaseTreatment(product=None, prob=None, eligibility=None, **kwargs)[source]#

Bases: Intervention

Base treatment class.

Parameters:
  • product (str/Product) – the treatment product to use

  • prob (float/arr) – probability of treatment aong those eligible

  • eligibility (inds/callable) – indices OR callable that returns inds

  • kwargs (dict) – passed to Intervention()

Attributes

has_product

Check if the intervention has a product

now

Shortcut to self.t.now()

states

Return a flat list of all states

statesdict

Return a flat dictionary (objdict) of all states

ti

Get the current module timestep

timevec

Shortcut to self.t.timevec

Methods

get_accept_inds()[source]#

Get indices of people who will acccept treatment; these people are then added to a queue or scheduled for receiving treatment

get_candidates()[source]#

Get candidates for treatment on this timestep. Implemented by derived classes.

step()[source]#

Perform treatment by getting candidates, checking their eligibility, and then treating them.