change_people_state#

class change_people_state(state_name, new_val, years=None, eligibility=None, prop=1.0, annual=False, **kwargs)[source]#

Bases: Intervention

Intervention to modify values of a People’s boolean state at one specific point in time.

Parameters:
  • state_name (string) – name of the People’s state that will be modified

  • new_val (bool, float) – the new state value eligible people will have

  • years (list, float) – The year we want to start the intervention. if years is None, uses start and end years of sim as defaults if years is a number or a list with a single element, eg, 2000.5, or [2000.5], this is interpreted as the start year of the intervention, and the end year of intervention will be the end of the simulation

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

  • prop (float) – a value between 0 and 1 indicating the x% of eligible people who will have the new state value

  • annual (bool) – whether the increase, prop, represents a “per year” increase, or per time step

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

check_eligibility()[source]#

Return an array of uids of agents eligible