Skip to content

condom_usage_parameters

CondomUsageParameters

Bases: Updateable

Source code in emodpy_hiv/demographics/condom_usage_parameters.py
class CondomUsageParameters(Updateable):
    def __init__(self,
                 min: float = 0,
                 mid: float = 0,
                 max: float = 0,
                 rate: float = 0):
        """
            Parameterizes condom usage over time, a component of EMOD relationship parameters.

            https://emod.idmod.org/emodpy-hiv/emod/sti-model-relationships.html#condom-usage
            https://emod.idmod.org/emodpy-hiv/emod/parameter-demographics.html#relationship-parameters

            Args:
                min: minimum condom usage probability (pre-inflection point)
                mid: inflection point in condom usage (a year)
                max: maximum condom usage probability (post-inflection point)
                rate: slope of condom usage at inflection point
        """
        super().__init__()
        self.min = min
        self.mid = mid
        self.max = max
        self.rate = rate

    def to_dict(self) -> Dict:
        usage = {
            'Min': self.min,
            'Mid': self.mid,
            'Max': self.max,
            'Rate': self.rate
        }
        return usage

    @classmethod
    def from_dict(cls, d: Dict) -> '__class__':
        return cls(min=d['Min'], mid=d['Mid'], max=d['Max'], rate=d['Rate'])

__init__(min=0, mid=0, max=0, rate=0)

Parameterizes condom usage over time, a component of EMOD relationship parameters.

https://emod.idmod.org/emodpy-hiv/emod/sti-model-relationships.html#condom-usage https://emod.idmod.org/emodpy-hiv/emod/parameter-demographics.html#relationship-parameters

Parameters:

Name Type Description Default
min float

minimum condom usage probability (pre-inflection point)

0
mid float

inflection point in condom usage (a year)

0
max float

maximum condom usage probability (post-inflection point)

0
rate float

slope of condom usage at inflection point

0
Source code in emodpy_hiv/demographics/condom_usage_parameters.py
def __init__(self,
             min: float = 0,
             mid: float = 0,
             max: float = 0,
             rate: float = 0):
    """
        Parameterizes condom usage over time, a component of EMOD relationship parameters.

        https://emod.idmod.org/emodpy-hiv/emod/sti-model-relationships.html#condom-usage
        https://emod.idmod.org/emodpy-hiv/emod/parameter-demographics.html#relationship-parameters

        Args:
            min: minimum condom usage probability (pre-inflection point)
            mid: inflection point in condom usage (a year)
            max: maximum condom usage probability (post-inflection point)
            rate: slope of condom usage at inflection point
    """
    super().__init__()
    self.min = min
    self.mid = mid
    self.max = max
    self.rate = rate