# Details of key entities

## Agent
**Class: Agent**

The Agent class has the following mandatory attribute:
- reference to the Schedule

Other key entities, such as the Population and Observer, will only be accessed by Agents through the Schedule.


### Agent subClass: Indiv
An Indiv is an Agent which represents a single human being. Indiv may have the following attributes:
- age (likely integer for years)
- sex (e.g., options defined by Enum)
- gender (e.g., options defined by Enum)
- sexual orientation (e.g., options defined by Enum)
- race/ethnicity (e.g., options defined by Enum)
- SES or income
- employment status, String
- health insurance status, Boolean(?)

For the VENUS Model, additional attributes might be:
- condom preference, 0 to 1 likelihood of using a condom in any sexual encounter
- infection status, a Set of sexually-transmitted infections the Indiv is currently infected with
- relationship status, a String, e.g., "married", "single"

For the SRD model, additional attributes might be:
- self-esteem score, float 0.0 to 1.0
- academic performance



### Examples of Other Agent subClasses
For the VENUS model:
- an infection of gonorrhea in a single Indiv host
- HealthCareProvider might be a separate kind of Agent which provides treatments to Indivs but is not themselves 
part of the infectious pool

For the SRD model:
- since we are focused on adolescents, Indivs may only be adolescents
- key adults, such as teachers, parents, faith leaders, could each be represented by their own subClasses, 
since they do not need all the same attributes as Indiv adolescents

## EdgeAgent
An EdgeAgent represents a relationship between two other Agents. 
EdgeAgents all have the following mandatory attributes:
- directed: Boolean indicating whether the edge is directional (True) or nondirectional (False)
- node0: Agent which is the source of the edge for a directional edge
- node1: Agent which is the receiving end of the edge for a directional edge
- Schedule

### Examples of EdgeAgent subClasses
For VENUS model:
- sexual relationship
  - starttime
  - duration
  - freq
- romantic relationship
  - starttime
  - status (casual, exclusive, married)
- treatment relationship (e.g., between Indiv and HealthCareProvider)

For SRD model:
- friendship (between Indivs)
  - strength
  - interaction freq
- parenting
- mentorship

## Collective
A Collective represents a group of Agents.
At minimum, the Collective has reference to all its Agent members as a Set.

Agents = {Agent1, Agent2, Agent3, ... AgentN}

### Collective subClass: Population
Population is a Collective which contains all the Indivs in the simulation.
The Population is created at initialization by the WorldBuilder.

### Examples of Other Collective subClasses
For VENUS model:
- city (containing both Indiv residents and HealthCareProviders operating in that jurisdiction)
- county
- MSM (containing only Indivs who identifying as men and who have a sexual orientation 
where men are potential sexual partners)
- MSW
- MSMW

For SRD model:
- school (containing both Indiv students and Teachers represented as a different type of Agent)
- neighborhood
- household
- church community/youth group

## Network
Class: NetworkManager
Similar to Collective :: Agents, a Network is a group of EdgeAgents. 
Different subClasses of EdgeAgent should be grouped as different Networks.
Network structure will be defined by extensions chosen by the user, e.g., NetworkX, igraph, etc.
At minimum, these data structures should store a unique identifier for each edge and references to 
the two nodes connected.

### Examples of NetworkManager subClasses
- FriendshipNetwork, containing all friendship edges in the SRD model
  - attribute, how much each friendship modifies self-esteem attribute of each Indiv
- CompleteSexualNetwork, containing all sexual relationships in the VENUS model


## Event
Events represent a single action of the simulation. Events will have the following mandatory attributes:
- t (Float) time when the action is to be executed
- actor (object instance) instance to call the action function, usually an Indiv
- action (function as String?) function to be called by the actor at time
- object (object instance or instances as List) any other references that the action function might take as arguments

### Examples of Event subClasses
Specific event sub-classes can be created for event types that occur repeatedly. 
- IndivEvent: an Event which takes only an Indiv as the actor
- ObserverEvent: an Evenet which takes only the Observer as the actor

## Schedule
Class: Scheduler
The Schedule will have the following mandatory attributes:
- a Heap (heapq) of Events
- reference to the Observer
- current time

There will only be a single Schedule per Simulation.

## Observer
Class: Observer
The Observer will have the following mandatory attributes:
- reference to the Schedule
- reference to the Population
- reference to all NetworkManagers

There will only be a single Observer per Simulation.

## Simulation
The Simulation will have attributes:
- run_file_name, a uniquely generated String containing batch_file_name + the unique run_number
- param_dict, a dictionary of parameter names (keys) and values
- reference to the Schedule

## Batch
The Batch will have attributes:
- a String representing the scenario of the Batch ("sweep" will be a type of scenario)
- param_config_list, and List of Dictionaries containing parameter names (as keys) and values (as values)
- batch_directory, a uniquely generate String used to label a directory for all the Batch's output
- batch_file_name, a uniquely generated String used to identify the Batch output, including both date and scenario info