people
Defines the People class
Classes
| Name | Description |
|---|---|
| People | Class for all the people in the simulation. |
| PeoplePars | Parameters for the people - includes demographic parameters such as age pyramid, |
People
people.People(n_agents=None, pars=None, **kwargs)Class for all the people in the simulation. Inherits from starsim.People, and adds a few additional states and methods specific to family planning simulations. Args: n_agents (int): Number of agents to create. If None, will be set later. pars (dict): Dictionary of parameters used to initialize states **kwargs: Additional keyword arguments passed to the parent class initializer.
Methods
| Name | Description |
|---|---|
| compute_method_usage | Computes method mix proportions from a sim object |
| cond_prob | Calculate conditional probability. This should be moved somewhere else. |
| int_age | Return ages as an integer |
| int_age_clip | Return ages as integers, clipped to maximum allowable age for pregnancy |
| plot | Plot histograms of each quantity |
| set_urban | Get initial distribution of urban |
| update_age_bin_totals | Count how many total live women in each 5-year age bin 10-50, for tabulating ASFR |
| update_post | Final updates at the very end of the timestep |
| update_results | Calculate and return the results for this specific time step |
compute_method_usage
people.People.compute_method_usage()Computes method mix proportions from a sim object Returns: list of lists where list[years_after_start][method_index] == proportion of fecundity aged women using that method on that year
cond_prob
people.People.cond_prob(a, b)Calculate conditional probability. This should be moved somewhere else.
int_age
people.People.int_age(uids=None)Return ages as an integer
int_age_clip
people.People.int_age_clip(uids=None)Return ages as integers, clipped to maximum allowable age for pregnancy
plot
people.People.plot(fig_args=None, hist_args=None)Plot histograms of each quantity
set_urban
people.People.set_urban(pars)Get initial distribution of urban
update_age_bin_totals
people.People.update_age_bin_totals(uids)Count how many total live women in each 5-year age bin 10-50, for tabulating ASFR
update_post
people.People.update_post()Final updates at the very end of the timestep
update_results
people.People.update_results()Calculate and return the results for this specific time step
PeoplePars
people.PeoplePars(**kwargs)Parameters for the people - includes demographic parameters such as age pyramid, urban proportion, wealth quintile distribution, and partnership parameters.
Functions
| Name | Description |
|---|---|
| make_people_pars | Shortcut for making a new instance of ContraPars |
make_people_pars
people.make_people_pars()Shortcut for making a new instance of ContraPars