# saimani5/ga-dkl architecture

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

- Interactive diagram: https://gitdiagram.com/saimani5/ga-dkl
- Repository: https://github.com/saimani5/ga-dkl

## Overview

GA-DKL contains research analyses for a manuscript, with FerroSim providing the sampled 2D ferroelectric simulation runtime. The visible command-line workflow constructs a simulator, runs it, then plots polarization; the simulation class also holds lattice state and produces results. The repository includes genetic-algorithm and policy experiment/visualization notebooks, but their internals were not sampled, so their connections to the runtime are not asserted.

Main entry points: [`src/ferrosim/run_main.py`](https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/run_main.py) (Simulation runner), [`src/ferrosim/ferrosim/simclass.py`](https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/ferrosim/simclass.py) (Ferro2DSim), [`src/ferrosim/ferrosim/lattice.py`](https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/ferrosim/lattice.py) (Lattice state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Simulation runtime"]
  node_runner["Simulation runner<br/>[run_main.py]"]
  node_simulator["Ferro2DSim<br/>[simclass.py]"]
  node_lattice["Lattice state<br/>[lattice.py]"]
end

subgraph group_research["Research analyses"]
  node_ga["GA experiments"]
  node_policy1["Policy 1 experiments"]
  node_policy2["Policy 2 simulations"]
  node_visualizer["Results visualizer"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs"| node_runner
node_runner -->|"constructs and runs"| node_simulator
node_runner -->|"requests plot"| node_simulator
node_simulator -->|"uses"| node_lattice

click node_runner "https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/run_main.py"
click node_simulator "https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/ferrosim/simclass.py"
click node_lattice "https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/ferrosim/lattice.py"
click node_ga "https://github.com/saimani5/ga-dkl/blob/main/GA_40Generations_main.ipynb"
click node_policy1 "https://github.com/saimani5/ga-dkl/blob/main/Policy1_experiments.ipynb"
click node_policy2 "https://github.com/saimani5/ga-dkl/blob/main/Policy2/Simulations_Take2.ipynb"
click node_visualizer "https://github.com/saimani5/ga-dkl/blob/main/Policy2/Results_visualizer_Take2.ipynb"

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_runner,node_simulator,node_lattice toneBlue
class node_ga,node_policy1,node_policy2,node_visualizer toneAmber
class node_researcher toneIndigo
```

## Components

### Simulation runtime

- [Simulation runner](https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/run_main.py): `src/ferrosim/run_main.py`
- [Ferro2DSim](https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/ferrosim/simclass.py): `src/ferrosim/ferrosim/simclass.py`
- [Lattice state](https://github.com/saimani5/ga-dkl/blob/main/src/ferrosim/ferrosim/lattice.py): `src/ferrosim/ferrosim/lattice.py`

### Research analyses

- [GA experiments](https://github.com/saimani5/ga-dkl/blob/main/GA_40Generations_main.ipynb): `GA_40Generations_main.ipynb`
- [Policy 1 experiments](https://github.com/saimani5/ga-dkl/blob/main/Policy1_experiments.ipynb): `Policy1_experiments.ipynb`
- [Policy 2 simulations](https://github.com/saimani5/ga-dkl/blob/main/Policy2/Simulations_Take2.ipynb): `Policy2/Simulations_Take2.ipynb`
- [Results visualizer](https://github.com/saimani5/ga-dkl/blob/main/Policy2/Results_visualizer_Take2.ipynb): `Policy2/Results_visualizer_Take2.ipynb`

### Other components

- **Researcher**

## Connections

- Researcher → Simulation runner: runs (evidence: `src/ferrosim/run_main.py`)
- Simulation runner → Ferro2DSim: constructs and runs (evidence: `src/ferrosim/run_main.py`)
- Simulation runner → Ferro2DSim: requests plot (evidence: `src/ferrosim/run_main.py`)
- Ferro2DSim → Lattice state: uses (evidence: `src/ferrosim/ferrosim/simclass.py`)
