# akeranen/the-one architecture

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

- Interactive diagram: https://gitdiagram.com/akeranen/the-one
- Repository: https://github.com/akeranen/the-one

## Overview

The ONE is an opportunistic-network simulator. Its main workflow is to configure and construct a scenario, advance simulated time and node movement, model connectivity and message routing, then expose simulation state and reports through text or graphical interfaces. The graph also preserves map-based movement, event input, connectivity models, and reporting as distinct capabilities. Evidence is limited to the README and the supplied excerpts and source index; unsampled subsystem links are omitted where their wiring is not established.

Main entry points: [`src/core/DTNHost.java`](https://github.com/akeranen/the-one/blob/master/src/core/DTNHost.java) (DTN host), [`src/gui`](https://github.com/akeranen/the-one/tree/master/src/gui) (Graphical interface), [`src/core/World.java`](https://github.com/akeranen/the-one/blob/master/src/core/World.java) (World scheduler), [`src/routing`](https://github.com/akeranen/the-one/tree/master/src/routing) (Routing strategies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Scenario setup"]
  node_settings["Settings<br/>[Settings.java]"]
  node_scenario["Scenario builder<br/>[SimScenario.java]"]
  node_eventinput["Event input"]
end

subgraph group_simulation["Simulation runtime"]
  node_world["World scheduler<br/>[World.java]"]
  node_host["DTN host<br/>[DTNHost.java]"]
  node_movement["Movement models"]
  node_maps["Map and routes"]
  node_coordinates["Coordinates and clock<br/>[Coord.java]"]
  node_modulebus["Module communication"]
end

subgraph group_network["Network behavior"]
  node_messages["Messages and listeners<br/>[Message.java]"]
  node_interfaces["Network interfaces"]
  node_connectivity["Connectivity models"]
  node_connections["Connections<br/>[Connection.java]"]
  node_routing["Routing strategies"]
  node_applications["Applications"]
end

subgraph group_observation["Interfaces and analysis"]
  node_textui["Text UI<br/>[DTNSimTextUI.java]"]
  node_ui["Simulation UI<br/>[DTNSimUI.java]"]
  node_reports["Reports"]
  node_gui["Graphical interface"]
end

node_operator(("Simulation user"))

node_operator -->|"starts simulation"| node_textui
node_textui -->|"delegates to"| node_ui
node_ui -->|"creates scenario"| node_scenario
node_scenario -->|"reads settings"| node_settings
node_scenario -->|"uses event queues"| node_eventinput
node_scenario -->|"creates world"| node_world
node_world -->|"processes events"| node_eventinput
node_world -->|"updates hosts"| node_host
node_host -->|"delegates movement"| node_movement
node_host -->|"delegates routing"| node_routing
node_host -->|"holds interfaces"| node_interfaces
node_host -->|"stores messages"| node_messages
node_movement -->|"uses map model"| node_maps
node_interfaces -->|"uses optimizer"| node_connectivity
node_interfaces -->|"creates connections"| node_connections
node_connections -->|"transfers messages"| node_routing
node_routing -->|"buffers messages"| node_messages
node_routing -->|"dispatches to apps"| node_applications
node_ui -->|"loads reports"| node_reports
node_ui -->|"runs simulation"| node_world
node_gui -->|"renders state"| node_world
node_gui -->|"renders nodes"| node_host
node_gui -->|"renders map"| node_maps
node_gui -->|"renders messages"| node_messages
node_gui -->|"shows routing info"| node_routing
node_host -.->|"publishes module state"| node_modulebus
node_host -->|"tracks location"| node_coordinates

click node_textui "https://github.com/akeranen/the-one/blob/master/src/ui/DTNSimTextUI.java"
click node_ui "https://github.com/akeranen/the-one/blob/master/src/ui/DTNSimUI.java"
click node_settings "https://github.com/akeranen/the-one/blob/master/src/core/Settings.java"
click node_scenario "https://github.com/akeranen/the-one/blob/master/src/core/SimScenario.java"
click node_eventinput "https://github.com/akeranen/the-one/tree/master/src/input"
click node_world "https://github.com/akeranen/the-one/blob/master/src/core/World.java"
click node_host "https://github.com/akeranen/the-one/blob/master/src/core/DTNHost.java"
click node_movement "https://github.com/akeranen/the-one/tree/master/src/movement"
click node_maps "https://github.com/akeranen/the-one/tree/master/src/movement/map"
click node_messages "https://github.com/akeranen/the-one/blob/master/src/core/Message.java"
click node_interfaces "https://github.com/akeranen/the-one/blob/master/src/core/NetworkInterface.java"
click node_connectivity "https://github.com/akeranen/the-one/tree/master/src/interfaces"
click node_connections "https://github.com/akeranen/the-one/blob/master/src/core/Connection.java"
click node_routing "https://github.com/akeranen/the-one/tree/master/src/routing"
click node_applications "https://github.com/akeranen/the-one/tree/master/src/applications"
click node_reports "https://github.com/akeranen/the-one/tree/master/src/report"
click node_gui "https://github.com/akeranen/the-one/tree/master/src/gui"
click node_coordinates "https://github.com/akeranen/the-one/blob/master/src/core/Coord.java"
click node_modulebus "https://github.com/akeranen/the-one/blob/master/src/core/ModuleCommunicationBus.java"

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_settings,node_scenario,node_eventinput,node_operator toneBlue
class node_world,node_host,node_movement,node_maps,node_coordinates,node_modulebus toneAmber
class node_messages,node_interfaces,node_connectivity,node_connections,node_routing,node_applications toneMint
class node_textui,node_ui,node_reports,node_gui toneRose
```

## Components

### Scenario setup

- [Settings](https://github.com/akeranen/the-one/blob/master/src/core/Settings.java): `src/core/Settings.java`
- [Scenario builder](https://github.com/akeranen/the-one/blob/master/src/core/SimScenario.java): `src/core/SimScenario.java`
- [Event input](https://github.com/akeranen/the-one/tree/master/src/input): `src/input`

### Simulation runtime

- [World scheduler](https://github.com/akeranen/the-one/blob/master/src/core/World.java): `src/core/World.java`
- [DTN host](https://github.com/akeranen/the-one/blob/master/src/core/DTNHost.java): `src/core/DTNHost.java`
- [Movement models](https://github.com/akeranen/the-one/tree/master/src/movement): `src/movement`
- [Map and routes](https://github.com/akeranen/the-one/tree/master/src/movement/map): `src/movement/map`
- [Coordinates and clock](https://github.com/akeranen/the-one/blob/master/src/core/Coord.java): `src/core/Coord.java`
- [Module communication](https://github.com/akeranen/the-one/blob/master/src/core/ModuleCommunicationBus.java): `src/core/ModuleCommunicationBus.java`

### Network behavior

- [Messages and listeners](https://github.com/akeranen/the-one/blob/master/src/core/Message.java): `src/core/Message.java`
- [Network interfaces](https://github.com/akeranen/the-one/blob/master/src/core/NetworkInterface.java): `src/core/NetworkInterface.java`
- [Connectivity models](https://github.com/akeranen/the-one/tree/master/src/interfaces): `src/interfaces`
- [Connections](https://github.com/akeranen/the-one/blob/master/src/core/Connection.java): `src/core/Connection.java`
- [Routing strategies](https://github.com/akeranen/the-one/tree/master/src/routing): `src/routing`
- [Applications](https://github.com/akeranen/the-one/tree/master/src/applications): `src/applications`

### Interfaces and analysis

- [Text UI](https://github.com/akeranen/the-one/blob/master/src/ui/DTNSimTextUI.java): `src/ui/DTNSimTextUI.java`
- [Simulation UI](https://github.com/akeranen/the-one/blob/master/src/ui/DTNSimUI.java): `src/ui/DTNSimUI.java`
- [Reports](https://github.com/akeranen/the-one/tree/master/src/report): `src/report`
- [Graphical interface](https://github.com/akeranen/the-one/tree/master/src/gui): `src/gui`

### Other components

- **Simulation user**

## Connections

- Simulation user → Text UI: starts simulation
- Text UI → Simulation UI: delegates to (evidence: `src/ui/DTNSimTextUI.java`)
- Simulation UI → Scenario builder: creates scenario (evidence: `src/ui/DTNSimUI.java`)
- Scenario builder → Settings: reads settings (evidence: `src/core/SimScenario.java`)
- Scenario builder → Event input: uses event queues (evidence: `src/core/SimScenario.java`)
- Scenario builder → World scheduler: creates world (evidence: `src/core/SimScenario.java`)
- World scheduler → Event input: processes events (evidence: `src/core/World.java`)
- World scheduler → DTN host: updates hosts (evidence: `src/core/World.java`)
- DTN host → Movement models: delegates movement (evidence: `src/core/DTNHost.java`)
- DTN host → Routing strategies: delegates routing (evidence: `src/core/DTNHost.java`)
- DTN host → Network interfaces: holds interfaces (evidence: `src/core/DTNHost.java`)
- DTN host → Messages and listeners: stores messages (evidence: `src/core/DTNHost.java`)
- Movement models → Map and routes: uses map model (evidence: `src/movement/MapBasedMovement.java`)
- Network interfaces → Connectivity models: uses optimizer (evidence: `src/core/NetworkInterface.java`)
- Network interfaces → Connections: creates connections (evidence: `src/core/NetworkInterface.java`)
- Connections → Routing strategies: transfers messages (evidence: `src/core/Connection.java`)
- Routing strategies → Messages and listeners: buffers messages (evidence: `src/routing/MessageRouter.java`)
- Routing strategies → Applications: dispatches to apps (evidence: `src/routing/MessageRouter.java`)
- Simulation UI → Reports: loads reports (evidence: `src/ui/DTNSimUI.java`)
- Simulation UI → World scheduler: runs simulation (evidence: `src/ui/DTNSimUI.java`)
- Graphical interface → World scheduler: renders state (evidence: `src/gui/playfield/PlayField.java`)
- Graphical interface → DTN host: renders nodes (evidence: `src/gui/playfield/PlayField.java`)
- Graphical interface → Map and routes: renders map (evidence: `src/gui/playfield/PlayField.java`)
- Graphical interface → Messages and listeners: renders messages (evidence: `src/gui/playfield/PlayField.java`)
- Graphical interface → Routing strategies: shows routing info (evidence: `src/gui/RoutingInfoWindow.java`)
- DTN host → Module communication: publishes module state (evidence: `src/core/DTNHost.java`)
- DTN host → Coordinates and clock: tracks location (evidence: `src/core/DTNHost.java`)
