Operators

Module for all of the default operators.

Relationship Operator

class Operators.RelationshipOperator(master)

Controls the formation and dissolution of relationships between agents. At initialization, the relationship operator creates the grid queues it will need to hold agent, and starts their functioning in seperate processes. Each time step, the relationship operator does three things:

  1. Dissolve relationships that have exceeded their duration
  2. Recruit from the grid queues into the main queue
  3. Iterate through main queue, attempting to match each suitor ` at the top of the queue.
dissolve_relationship(agent1, agent2)

Dissolves a relationship between agent1 and agent2.

duration(agent1, agent2)

Returns a duration given two agents.

Can test some qualities of the agents to assess what kind of relationship they would form (i.e., transitory, casual, marriage).

form_relationship(agent1, agent2)

Forms a relationship between agent1 and agent2.

match()

Pop a suitor off the main queue and try to match him or her.

recruit()

Pick a random grid queue and send a request for a recruit. Recruited individuals are then added to the main_queue (self.master.main_queue).

step()

Take a single time step in the simulation.

update()

Decrement duration of relationships by 1 week, remove relationships that have expired.

Time Operator

class Operators.TimeOperator(master)

Controls the progression of time in the simulation. In particular, the time operator removes agents that are beyond a maximum age, and moves agents between grid queues.

remove(agent)

Function for removing agents from the simulation.

step()

Take a single step in the simulation: Go through agents, remove agents that are too old, and move agents to new grid queue (if required.)

Infection Operator

class Operators.InfectionOperator(master)

Controls the progression of the sexually transmitted disease.

perform_initial_infections(initial_prevalence, seed_time)

Seeds the population with initial_prevalence at seed_time.

step()

Take a single step in the simulation: Go through relationships, if relationship is serodiscordant, infect the uninfected partner with probablity this is relative to infectivity.

Table Of Contents

Previous topic

Community

Next topic

Grid Queue

This Page