# nimicdeosebit/digital-gorilla architecture

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

- Interactive diagram: https://gitdiagram.com/nimicdeosebit/digital-gorilla
- Repository: https://github.com/nimicdeosebit/digital-gorilla

## Overview

digital-gorilla is a small Python model of how power shares evolve among four actors across five modalities. Its main demonstrated workflow starts from an initial share matrix, computes actor effort and state-dependent capability, applies a selected contest rule over repeated rounds, then evaluates and plots outcomes. The mechanisms and update rate are configurable; plots compare rules, show aspiration versus stability, display the share matrix, and sweep spillover gains. The README provides no additional product detail, so this map follows the behavior shown in the source excerpts.

Main entry points: [`plots.py`](https://github.com/nimicdeosebit/digital-gorilla/blob/main/plots.py) (Simulation and plots), [`mechanisms.py`](https://github.com/nimicdeosebit/digital-gorilla/blob/main/mechanisms.py) (Epistemic spillover), [`contest.py`](https://github.com/nimicdeosebit/digital-gorilla/blob/main/contest.py) (Contest updates), [`state.py`](https://github.com/nimicdeosebit/digital-gorilla/blob/main/state.py) (Initial shares)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_state["Model state"]
  node_initial["Initial shares<br/>[state.py]"]
end

subgraph group_dynamics["Power dynamics"]
  node_agents["Effort and capability<br/>[agents.py]"]
  node_mechanisms["Epistemic spillover<br/>[mechanisms.py]"]
  node_contest["Contest updates<br/>[contest.py]"]
end

subgraph group_analysis["Analysis and plots"]
  node_metrics["Outcome metrics<br/>[metrics.py]"]
  node_plots["Simulation and plots<br/>[plots.py]"]
end

subgraph group_settings["Model settings"]
  node_config["Parameters<br/>[config.py]"]
end

node_agents -->|"computes capability via"| node_mechanisms
node_mechanisms -->|"uses state dimensions"| node_initial
node_mechanisms -->|"reads gains"| node_config
node_contest -->|"normalizes shares"| node_initial
node_contest -->|"reads update settings"| node_config
node_plots -->|"starts runs from"| node_initial
node_plots -->|"computes scores with"| node_agents
node_plots -->|"advances rounds with"| node_contest
node_plots -->|"sweeps spillover"| node_mechanisms
node_plots -->|"plots outcomes using"| node_metrics
node_plots -->|"reads run settings"| node_config

click node_initial "https://github.com/nimicdeosebit/digital-gorilla/blob/main/state.py"
click node_agents "https://github.com/nimicdeosebit/digital-gorilla/blob/main/agents.py"
click node_mechanisms "https://github.com/nimicdeosebit/digital-gorilla/blob/main/mechanisms.py"
click node_contest "https://github.com/nimicdeosebit/digital-gorilla/blob/main/contest.py"
click node_config "https://github.com/nimicdeosebit/digital-gorilla/blob/main/config.py"
click node_metrics "https://github.com/nimicdeosebit/digital-gorilla/blob/main/metrics.py"
click node_plots "https://github.com/nimicdeosebit/digital-gorilla/blob/main/plots.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_initial toneBlue
class node_agents,node_mechanisms,node_contest toneAmber
class node_metrics,node_plots toneMint
class node_config toneRose
```

## Components

### Model state

- [Initial shares](https://github.com/nimicdeosebit/digital-gorilla/blob/main/state.py): `state.py`

### Power dynamics

- [Effort and capability](https://github.com/nimicdeosebit/digital-gorilla/blob/main/agents.py): `agents.py`
- [Epistemic spillover](https://github.com/nimicdeosebit/digital-gorilla/blob/main/mechanisms.py): `mechanisms.py`
- [Contest updates](https://github.com/nimicdeosebit/digital-gorilla/blob/main/contest.py): `contest.py`

### Analysis and plots

- [Outcome metrics](https://github.com/nimicdeosebit/digital-gorilla/blob/main/metrics.py): `metrics.py`
- [Simulation and plots](https://github.com/nimicdeosebit/digital-gorilla/blob/main/plots.py): `plots.py`

### Model settings

- [Parameters](https://github.com/nimicdeosebit/digital-gorilla/blob/main/config.py): `config.py`

## Connections

- Effort and capability → Epistemic spillover: computes capability via (evidence: `agents.py`)
- Epistemic spillover → Initial shares: uses state dimensions (evidence: `mechanisms.py`)
- Epistemic spillover → Parameters: reads gains (evidence: `mechanisms.py`)
- Contest updates → Initial shares: normalizes shares (evidence: `contest.py`)
- Contest updates → Parameters: reads update settings (evidence: `contest.py`)
- Simulation and plots → Initial shares: starts runs from (evidence: `plots.py`)
- Simulation and plots → Effort and capability: computes scores with (evidence: `plots.py`)
- Simulation and plots → Contest updates: advances rounds with (evidence: `plots.py`)
- Simulation and plots → Epistemic spillover: sweeps spillover (evidence: `plots.py`)
- Simulation and plots → Outcome metrics: plots outcomes using (evidence: `plots.py`)
- Simulation and plots → Parameters: reads run settings (evidence: `plots.py`)
