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

now

Return the current time, i.e. the time vector at the current timestep.

states

Return a flat list of all states

statesdict

Return a flat dictionary (objdict) of all states

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.