HIV
Bases: BaseExposure
Source code in titan/exposures/hiv.py
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 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 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 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 |
|
agents: Set[agent.Agent] = set()
class-attribute
instance-attribute
Agents with active hiv
dx_counts: Dict[str, Dict[str, int]] = {}
class-attribute
instance-attribute
Counts of diagnosed agents by race and sex_type
stats: List[str] = ['hiv', 'hiv_dx', 'hiv_aids', 'hiv_new', 'hiv_dx_new']
class-attribute
instance-attribute
HIV collects the following stats:
- hiv - number of agents with active hiv
- hiv_dx - number of agents with diagnosed hiv
- hiv_aids - number of agents with aids
- hiv_new - number of agents converted to hiv this timestep
- hiv_dx_new - number of agents with diagnosed with hiv this timestep
add_agent(agent)
classmethod
Add an agent to the class (not instance). This can be useful if tracking population level statistics or groups, such as counts or newly active agents.
Add the agent to the agents
set and if the agent is diagnosed, updated the dx_counts
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent |
Agent
|
the agent to add to the class attributes |
required |
Source code in titan/exposures/hiv.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
convert(model)
Agent becomes HIV agent. Update all appropriate attributes, sets and dictionaries.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
TITAN
|
The model being run |
required |
Source code in titan/exposures/hiv.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
diagnose(model)
Mark the agent as diagnosed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
TITAN
|
the running model |
required |
Source code in titan/exposures/hiv.py
290 291 292 293 294 295 296 297 298 299 |
|
expose(model, interaction, rel, num_acts)
staticmethod
Expose a relationship to the exposure for a number of acts of a specific interaction type. Typically, this is determining if the exposure can cause conversion/change in one of the agents, then if so determining the probability of that and then converting the succeptible agent.
For hiv, one agent must be active and the other not for an exposure to cause conversion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
TITAN
|
The running model |
required |
interaction |
str
|
The type of interaction (e.g. sex, injection) |
required |
rel |
Relationship
|
The relationship where the interaction is occuring |
required |
num_acts |
int
|
The number of acts of that interaction |
required |
Source code in titan/exposures/hiv.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
get_acute_status(time)
Get acute status of agent at time
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time |
int
|
The current time step |
required |
Returns:
Type | Description |
---|---|
bool
|
whether an agent is acute |
Source code in titan/exposures/hiv.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
|
get_transmission_probability(model, interaction, partner, num_acts)
Determines the probability of an hiv transmission event from agent to partner based on interaction type and numer of acts. For sex acts, transmission probability is a function of the acquisition probability of the HIV- agent's sex role and the HIV+ agent's haart adherence, acute status, and dx risk reduction
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
TITAN
|
The running model |
required |
interaction |
"injection" or "sex" |
required | |
partner |
Agent
|
HIV- Agent |
required |
num_acts |
int
|
The number of exposure interactions the agents had this time step |
required |
Returns:
Type | Description |
---|---|
float
|
probability of transmission from agent to partner |
Source code in titan/exposures/hiv.py
198 199 200 201 202 203 204 205 206 207 208 209 210 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 |
|
init_agent(pop, time)
Initialize the agent for this exposure during population initialization (Population.create_agent
). Called on only exposures that are enabled per the params.
Based on demographic params for the agent, stochastically determine if hiv is active, and if active, at what past time point was the agent converted, if the agent is diagnosed, and if the agent has aids.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pop |
Population
|
the population this agent is a part of |
required |
time |
int
|
the current time step |
required |
Source code in titan/exposures/hiv.py
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 |
|
init_class(params)
classmethod
Initialize any diagnosis counts and the agents set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
parameters for this population |
required |
Source code in titan/exposures/hiv.py
38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
progress_to_aids(model)
Model the progression of HIV agents to AIDS agents
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
TITAN
|
the running model |
required |
Source code in titan/exposures/hiv.py
321 322 323 324 325 326 327 328 329 330 331 332 |
|
remove_agent(agent)
classmethod
Remove an agent from the class (not instance). This can be useful if tracking population level statistics or groups, such as counts.
Remove the agent from the agents
set and decrement the dx_counts
if the agent was diagnosed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
agent |
Agent
|
the agent to remove from the class attributes |
required |
Source code in titan/exposures/hiv.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
update_agent(model)
Update the agent for this exposure for a time step. Called once per time step in TITAN.update_all_agents
. Agent level updates are done after population level updates. Called on only exposures that are enabled per the params.
If the agent is hiv+ and the model time is past the hiv start_time, determine if the agent becomes diagnosed if not yet diagnosed, and if the agent has progressed to aids.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
TITAN
|
the instance of TITAN currently being run |
required |
Source code in titan/exposures/hiv.py
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 |
|