people
people
Defines the People class.
Classes
| Name | Description |
|---|---|
| People | The people in the simulation: their ages and sexes, and (once in a sim) their disease states. |
People
people.People(n_agents, age_data=None, **kwargs)The people in the simulation: their ages and sexes, and (once in a sim) their disease states.
The disease states (e.g. people.exposed) are stored on the COVID module (sim.diseases.covid), but can be read from the people as in v3. Dates such as people.date_infectious are the time indices (e.g. ti_infectious), since the timestep is one day. The per-agent arrays only include agents who are alive, except for people.dead and people.date_dead, which cover every agent ever created.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| n_agents | int | the number of agents | required |
| age_data | array / dataframe |
the age distribution, either as Covasim’s (minimum age, maximum age, fraction) rows (e.g. from cv.data.get_age_distribution()) or as Starsim’s (lower edge, value) rows; defaults to Covasim’s default age distribution |
None |
| kwargs | dict | passed to ss.People (e.g. extra_states) |
{} |
Example::
people = cv.People(1000, age_data=cv.data.get_age_distribution('nigeria'))
sim = cv.Sim(people=people, pop_size=1000)
Methods
| Name | Description |
|---|---|
| plot | Plot statistics of the population – age distribution, numbers of contacts, and overall weight of contacts (number of contacts multiplied by beta per layer); see cv.plot_people() |
plot
people.People.plot(*args, **kwargs)Plot statistics of the population – age distribution, numbers of contacts, and overall weight of contacts (number of contacts multiplied by beta per layer); see cv.plot_people()