demographics
demographics
Define demographic modules used within STIsim
Classes
| Name | Description |
|---|---|
| Migration | Demographic module that adds and removes migrants each timestep. |
Migration
demographics.Migration(pars=None, migration_data=None, **kwargs)Demographic module that adds and removes migrants each timestep.
Reads a migration data source specifying the net number of migrants per year. Positive values add immigrants (cloned from existing agents with matching age/sex); negative values remove emigrants chosen by a per-agent migration propensity score.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| pars | dict | Parameter overrides (e.g. migration_propensity, slot_scale, min_slots). |
None |
| migration_data | DataFrame |
Must contain 'Time' and 'Value' columns giving the net number of migrants per year. |
None |
| **kwargs | Additional parameter overrides. | {} |
Methods
| Name | Description |
|---|---|
| get_migrants | Get the number of migrants for this timestep |
| init_migration_propensity | Set individual’s propensity to migrate |
| make_immigrants | Make immigrants by making copies of existing agents |
| remove_emigrants | Remove people who’ve decided to emigrate this timestep |
| step | Perform all updates |
| step_migration | Select people to migrate |
get_migrants
demographics.Migration.get_migrants()Get the number of migrants for this timestep
init_migration_propensity
demographics.Migration.init_migration_propensity()Set individual’s propensity to migrate This is currently a random variable but could be defined as a function of age/sex/other properties
make_immigrants
demographics.Migration.make_immigrants(twin_uids)Make immigrants by making copies of existing agents
remove_emigrants
demographics.Migration.remove_emigrants()Remove people who’ve decided to emigrate this timestep
step
demographics.Migration.step()Perform all updates
step_migration
demographics.Migration.step_migration()Select people to migrate