demographics_overlay
DemographicsOverlay
Bases: DemographicsBase
This class 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. The intended use is for a user to pass a
self-built default OverlayNode object in to represent the Defaults section in the demographics overlay.
Source code in emod_api/demographics/demographics_overlay.py
__init__(default_node, nodes=None, idref=None)
An object representation of an EMOD demographics overlay input (file). The contents are interpreted by EMOD at runtime as overrides to the canonical/primary demographics input file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default_node
|
OverlayNode
|
(OverlayNode) Contains default settings for nodes in the overlay. |
required |
nodes
|
List[OverlayNode]
|
Overlay is applied to these nodes. Default is no nodes. |
None
|
idref
|
str
|
a name used to indicate files (demographics, climate, and migration) are used together |
None
|
Source code in emod_api/demographics/demographics_overlay.py
to_file(file_name='demographics_overlay.json')
Writes the DemographicsOverlay to an EMOD-compatible json file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name
|
str
|
The filepath to write to. |
'demographics_overlay.json'
|
Returns:
| Type | Description |
|---|---|
None
|
Nothing |