properties_and_attributes
IndividualAttributes
Bases: Updateable
Source code in emod_api/demographics/properties_and_attributes.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 | |
__init__(age_distribution_flag=None, age_distribution1=None, age_distribution2=None, age_distribution=None, susceptibility_distribution_flag=None, susceptibility_distribution1=None, susceptibility_distribution2=None, susceptibility_distribution=None, prevalence_distribution_flag=None, prevalence_distribution1=None, prevalence_distribution2=None, risk_distribution_flag=None, risk_distribution1=None, risk_distribution2=None, migration_heterogeneity_distribution_flag=None, migration_heterogeneity_distribution1=None, migration_heterogeneity_distribution2=None, fertility_distribution=None, mortality_distribution_male=None, mortality_distribution_female=None, innate_immune_distribution_flag=None, innate_immune_distribution1=None, innate_immune_distribution2=None)
Defines the initial distribution of attributes for model agents for all disease setups. These are used by Node objects and can be defined separately per-node. Some attributes utilize simple distributions, some utilize complex distributions, some can utilize either simple or complex. For those that can utilize simple or complex distributions, only one may be specified (it is a user choice). It is highly unlikely a user will utilize this class directly, as it exists primarily for ensuring proper serialization to JSON for EMOD input file representation. The standard, user-facing interface for updating the distributions used is in the Demographics class in emodpy.demographics .
Supported simple distributions and the meaning of their parameters are defined in the emod_api.utils.distributions submodule.
Further information can be found at: https://docs.idmod.org/projects/emod-generic/en/latest/parameter-demographics.html#individual-attributes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
age_distribution_flag
|
int
|
Toggles the type of simple distribution for representing age, determining the distribution-specific interpretation of age_distribution1 and age_distribution2. Mutually exclusive with a complex age distribution (age_distribution). |
None
|
age_distribution1
|
int
|
If age_distribution_flag is not None, the specified simple distribution-dependent first argument. |
None
|
age_distribution2
|
int
|
If age_distribution_flag is not None, the specified simple distribution-dependent second argument (if any). |
None
|
age_distribution
|
AgeDistribution
|
If provided, defines a complex age distribution. Mutually exclusive with a simple age distribution (age_distribution_flag). |
None
|
susceptibility_distribution_flag
|
int
|
Toggles the type of simple distribution for representing susceptibility, determining the distribution-specific interpretation of susceptibility_distribution1 and susceptibility_distribution2. Mutually exclusive with a complex susceptibility distribution (susceptibility_distribution). |
None
|
susceptibility_distribution1
|
int
|
If susceptibility_distribution_flag is not None, the specified simple distribution-dependent first argument. |
None
|
susceptibility_distribution2
|
int
|
If susceptibility_distribution_flag is not None, the specified simple distribution-dependent second argument (if any). |
None
|
susceptibility_distribution
|
SusceptibilityDistribution
|
If provided, defines a complex susceptibility distribution. Mutually exclusive with a simple susceptibility distribution (susceptibility_distribution_flag). |
None
|
prevalence_distribution_flag
|
int
|
Toggles the type of simple distribution for representing prevalence, determining the distribution-specific interpretation of prevalence_distribution1 and prevalence_distribution2. |
None
|
prevalence_distribution1
|
int
|
If prevalence_distribution_flag is not None, the specified simple distribution-dependent first argument. |
None
|
prevalence_distribution2
|
int
|
If prevalence_distribution_flag is not None, the specified simple distribution-dependent second argument (if any). |
None
|
risk_distribution_flag
|
int
|
Toggles the type of simple distribution for representing risk, determining the distribution-specific interpretation of risk_distribution1 and risk_distribution2. |
None
|
risk_distribution1
|
int
|
If risk_distribution_flag is not None, the specified simple distribution-dependent first argument. |
None
|
risk_distribution2
|
int
|
If risk_distribution_flag is not None, the specified simple distribution-dependent second argument (if any). |
None
|
migration_heterogeneity_distribution_flag
|
int
|
Toggles the type of simple distribution for representing migration heterogeneity, determining the distribution-specific interpretation of migration_heterogeneity_distribution1 and migration_heterogeneity_distribution2. |
None
|
migration_heterogeneity_distribution1
|
int
|
If migration_heterogeneity_distribution_flag is not None, the specified simple distribution-dependent first argument. |
None
|
migration_heterogeneity_distribution2
|
int
|
If migration_heterogeneity_distribution_flag is not None, the specified simple distribution-dependent second argument (if any). |
None
|
fertility_distribution
|
FertilityDistribution
|
If provided, defines a complex fertility distribution for females. |
None
|
mortality_distribution_male
|
MortalityDistribution
|
If provided, defines a complex mortality distribution for males. |
None
|
mortality_distribution_female
|
MortalityDistribution
|
If provided, defines a complex mortality distribution for females. |
None
|
innate_immune_distribution_flag
|
int
|
Toggles the type of simple distribution for representing innate immunity, determining the distribution-specific interpretation of innate_immune_distribution1 and innate_immune_distribution2. |
None
|
innate_immune_distribution1
|
int
|
If innate immune_distribution_flag is not None, the specified simple distribution-dependent first argument. |
None
|
innate_immune_distribution2
|
int
|
If innate immune_distribution_flag is not None, the specified simple distribution-dependent second argument (if any). |
None
|
Source code in emod_api/demographics/properties_and_attributes.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | |
IndividualProperties
Bases: Updateable
A container class for holding IndividualProperty objects used by Node objects. It simply contains functionality for adding, removing, and retrieving contained IndividualProperty objects with some light consistency checking (preventing duplicate-named IndividualProperties).
Source code in emod_api/demographics/properties_and_attributes.py
__init__(individual_properties=None)
https://docs.idmod.org/projects/emod-generic/en/latest/model-properties.html
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual_properties
|
list[IndividualProperty]
|
list of individual properties to include. Default is no individual_properties. |
None
|
Source code in emod_api/demographics/properties_and_attributes.py
IndividualProperty
Bases: Updateable
Source code in emod_api/demographics/properties_and_attributes.py
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
__init__(property, values, initial_distribution=None, transitions=None, transmission_matrix=None, transmission_route='Contact')
Add Individual Properties, including an optional HINT configuration matrix.
Individual properties act as 'labels' on model agents that can be used for identifying and targeting subpopulations in campaign elements and reports. E.g. model agents may be given a property ('Accessibility') that labels them as either having access to health care (value: 'Yes') or not (value: 'No').
Property-based heterogeneous disease transmission (HINT) is available for generic, environmental, typhoid, airborne, or TBHIV simulations as other simulation types have parameters for modeling the heterogeneity of transmission. By default, transmission is assumed to occur homogeneously among the population within a node.
EMOD requires individual property key and values (property and values args) to be the same across all
nodes. The individual distributions of individual properties (initial_distribution) can vary acros nodes.
Note: For HINT, you will also need to set config parameter Enable_Heterogeneous_Intranode_Transmission to 1
likely with config.parameters.Enable_Heterogeneous_Intranode_Transmission = 1
Documentation of individual properties and HINT
For malaria, see :doc:emod-malaria:emod/model-properties
and for HIV, see :doc:emod-hiv:emod/model-properties.
For malaria, see :doc:emod-malaria:emod/model-hint
and for HIV, see :doc:emod-hiv:emod/model-hint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property
|
str
|
a new individual property key to add. If property already exists an exception is raised unless overwrite_existing is True. |
required |
values
|
Union[list[float], list[str]]
|
A list of valid values for the property, or, if creating age-based transmission, age edges for the 'Age_Bin' property. E.g. ['Yes', 'No'] for an 'Accessibility' property. |
required |
initial_distribution
|
list[float]
|
The fractional, between 0 and 1, initial distribution of each valid values entry. Order must match values argument. The values must add up to 1. |
None
|
transmission_matrix
|
list[list[float]]
|
HINT transmission matrix. For malaria, see :doc: |
None
|
transmission_route
|
str
|
The route of transmission. Default is 'Contact'. Available routes are 'Contact' and 'Environmental'. |
'Contact'
|
transitions
|
list[dict]
|
A list of dictionaries that each define how an individual transitions
from one property value to another. For malaria, see :doc: |
None
|
Source code in emod_api/demographics/properties_and_attributes.py
NodeAttributes
Bases: Updateable
Source code in emod_api/demographics/properties_and_attributes.py
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | |
__init__(airport=None, altitude=None, area=None, birth_rate=None, country=None, growth_rate=None, name=None, latitude=None, longitude=None, metadata=None, initial_population=None, region=None, seaport=None, larval_habitat_multiplier=None, initial_vectors_per_species=None, infectivity_multiplier=None, extra_attributes=None)
Defines node-specific attributes for all disease setups, utilized by Node objects.
Further information can be found at: https://docs.idmod.org/projects/emod-generic/en/latest/parameter-demographics.html#nodeattributes https://docs.idmod.org/projects/emod-malaria/en/latest/parameter-demographics.html#nodeattributes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
airport
|
int
|
Whether the node has an airport (1 for true, 0 for false). |
None
|
altitude
|
float
|
Altitude of the node (in meters). |
None
|
area
|
float
|
Spatial size of the node (TODO: unknown units) |
None
|
birth_rate
|
float
|
The birth rate in births/day/woman . |
None
|
country
|
str
|
Name of the country the node is in. |
None
|
growth_rate
|
float
|
TODO: unknown |
None
|
name
|
str
|
Name of the node |
None
|
latitude
|
float
|
Latitude of the node in degrees. |
None
|
longitude
|
float
|
Longitude of the node in degrees. |
None
|
metadata
|
dict
|
An arbitrary dict of metaaata key/values to add to the node for notation. |
None
|
initial_population
|
int
|
The initial number of people/agents in the node. |
None
|
region
|
int
|
Whether the node has a road network (1 for true, 0 for false). |
None
|
seaport
|
int
|
Whether the node has a seaport (1 for true, 0 for false). |
None
|
larval_habitat_multiplier
|
list(float)
|
The value(s) by which to scale the larval habitat availability specified in the configuration file with Larval_Habitat_Types. |
None
|
initial_vectors_per_species
|
dict or int
|
The initial number of vectors per species in the node. |
None
|
infectivity_multiplier
|
float
|
TODO: unknown |
None
|
extra_attributes
|
dict
|
An arbitrary dict of attribute key/values to add to the node. |
None
|