# patra-arya/anisogamy architecture

> Architecture diagram of the GitHub repository patra-arya/anisogamy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/patra-arya/anisogamy
- Repository: https://github.com/patra-arya/anisogamy

## Overview

anisogamy is a computational reproduction of a game-theoretic model for the evolution of sperm–egg size dimorphism. The main workflow evaluates survival and reproductive fitness, computes a best response, iterates that response, and classifies the resulting equilibrium as isogamy or anisogamy. Parameter sweeps and plotting extend the analysis with bifurcation results, best-response maps, and cobweb diagrams. The README documents alternative survival functions and a grid-search best response. Wiring below follows the sampled source; no separate external service or persistent store is evident.

Main entry points: [`src/anisogamy/plot.py`](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/plot.py) (Maps and diagrams), [`src/anisogamy/dynamics.py`](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/dynamics.py) (Regime classification), [`src/anisogamy/best_response.py`](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/best_response.py) (Best response), [`src/anisogamy/fitness.py`](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/fitness.py) (Log fitness)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_biology["Survival and fitness"]
  node_survival["Survival functions<br/>[survival.py]"]
  node_fitness["Log fitness<br/>[fitness.py]"]
  node_isogamous_ess["Isogamous ESS<br/>[fitness.py]"]
end

subgraph group_optimization["Strategy optimization"]
  node_best_response["Best response<br/>[best_response.py]"]
  node_grid_response["Grid-search response<br/>[best_response.py]"]
end

subgraph group_dynamics["Evolutionary dynamics"]
  node_iterate["Response iteration<br/>[dynamics.py]"]
  node_classify["Regime classification<br/>[dynamics.py]"]
  node_bifurcation_sweep["Bifurcation sweep<br/>[dynamics.py]"]
end

subgraph group_visualization["Analysis and plots"]
  node_plotting["Maps and diagrams<br/>[plot.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"requests classification"| node_classify
node_researcher -->|"requests plots"| node_plotting
node_classify -->|"runs trajectory"| node_iterate
node_iterate -->|"updates strategy"| node_best_response
node_best_response -->|"ranks candidates"| node_fitness
node_fitness -->|"evaluates survival"| node_survival
node_bifurcation_sweep -->|"classifies parameters"| node_classify
node_plotting -->|"samples responses"| node_best_response
node_plotting -->|"builds cobweb"| node_iterate
node_plotting -->|"plots regimes"| node_classify

click node_survival "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/survival.py"
click node_fitness "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/fitness.py"
click node_isogamous_ess "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/fitness.py"
click node_best_response "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/best_response.py"
click node_grid_response "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/best_response.py"
click node_iterate "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/dynamics.py"
click node_classify "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/dynamics.py"
click node_bifurcation_sweep "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/dynamics.py"
click node_plotting "https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/plot.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_survival,node_fitness,node_isogamous_ess toneBlue
class node_best_response,node_grid_response toneAmber
class node_iterate,node_classify,node_bifurcation_sweep toneMint
class node_plotting toneRose
class node_researcher toneIndigo
```

## Components

### Survival and fitness

- [Survival functions](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/survival.py): `src/anisogamy/survival.py`
- [Log fitness](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/fitness.py): `src/anisogamy/fitness.py`
- [Isogamous ESS](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/fitness.py): `src/anisogamy/fitness.py`

### Strategy optimization

- [Best response](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/best_response.py): `src/anisogamy/best_response.py`
- [Grid-search response](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/best_response.py): `src/anisogamy/best_response.py`

### Evolutionary dynamics

- [Response iteration](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/dynamics.py): `src/anisogamy/dynamics.py`
- [Regime classification](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/dynamics.py): `src/anisogamy/dynamics.py`
- [Bifurcation sweep](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/dynamics.py): `src/anisogamy/dynamics.py`

### Analysis and plots

- [Maps and diagrams](https://github.com/patra-arya/anisogamy/blob/main/src/anisogamy/plot.py): `src/anisogamy/plot.py`

### Other components

- **Researcher**

## Connections

- Researcher → Regime classification: requests classification
- Researcher → Maps and diagrams: requests plots
- Regime classification → Response iteration: runs trajectory
- Response iteration → Best response: updates strategy
- Best response → Log fitness: ranks candidates
- Log fitness → Survival functions: evaluates survival
- Bifurcation sweep → Regime classification: classifies parameters
- Maps and diagrams → Best response: samples responses
- Maps and diagrams → Response iteration: builds cobweb
- Maps and diagrams → Regime classification: plots regimes
