Skip to content

hiv_node

HIVNode

Bases: Node

Source code in emodpy_hiv/demographics/hiv_node.py
class HIVNode(Node):
    def __init__(self, society: Society = None, **kwargs: Any):
        """
        An extension of emod-api Node that adds society representation of interpersonal relationships for HIV
        simulations. HIVNode can be used to represent individual simulation nodes and an EMOD 'Defaults' node. To be
        used with HIVDemographics objects, which require HIVNodes.

        Args:
            society: an initialized Society object to be used with this simulation node.
            **kwargs: arguments passed along to the Node constructor
        """
        super().__init__(**kwargs)
        self.society = Society() if society is None else society

    def to_dict(self) -> Dict:
        result = super().to_dict()
        result['Society'] = self.society.to_dict()
        return result

__init__(society=None, **kwargs)

An extension of emod-api Node that adds society representation of interpersonal relationships for HIV simulations. HIVNode can be used to represent individual simulation nodes and an EMOD 'Defaults' node. To be used with HIVDemographics objects, which require HIVNodes.

Parameters:

Name Type Description Default
society Society

an initialized Society object to be used with this simulation node.

None
**kwargs Any

arguments passed along to the Node constructor

{}
Source code in emodpy_hiv/demographics/hiv_node.py
def __init__(self, society: Society = None, **kwargs: Any):
    """
    An extension of emod-api Node that adds society representation of interpersonal relationships for HIV
    simulations. HIVNode can be used to represent individual simulation nodes and an EMOD 'Defaults' node. To be
    used with HIVDemographics objects, which require HIVNodes.

    Args:
        society: an initialized Society object to be used with this simulation node.
        **kwargs: arguments passed along to the Node constructor
    """
    super().__init__(**kwargs)
    self.society = Society() if society is None else society