demographics_overlay
DemographicsOverlay
Bases: DemographicsBase
In contrast to class :py:obj:emod_api:emod_api.demographics.Demographics
this class does not set any defaults.
It inherits from :py:obj:emod_api:emod_api.demographics.DemographicsBase
so all functions that can be used to
create demographics can also be used to create an overlay file. Parameters can be changed/set specifically by
passing node_id, individual attributes, and individual attributes to the constructor.
Source code in emod_api/demographics/demographics_overlay.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
__init__(nodes=None, idref=None, individual_attributes=None, node_attributes=None)
A class to create demographic overlays.
Args:
nodes: Overlay is applied to these nodes.
idref: a name used to indicate files (demographics, climate, and migration) are used together
individual_attributes: Object of type
:py:obj:emod_api:emod_api.demographics.PropertiesAndAttributes.IndividualAttributes
to overwrite individual attributes
node_attributes: Object of type
:py:obj:
emod_api:emod_api.demographics.PropertiesAndAttributes.NodeAttributes
to overwrite individual attributes
Source code in emod_api/demographics/demographics_overlay.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
to_file(file_name='demographics_overlay.json')
Write the contents of the instance to an EMOD-compatible (JSON) file.
Source code in emod_api/demographics/demographics_overlay.py
60 61 62 63 64 65 |
|