# lukmanharahap/fuzzy-dwa architecture

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

- Interactive diagram: https://gitdiagram.com/lukmanharahap/fuzzy-dwa
- Repository: https://github.com/lukmanharahap/fuzzy-dwa

## Overview

This repository is a 2D warehouse-robot navigation simulator and research comparison of fixed-weight DWA against fuzzy-adaptive DWA. Users run a single or multi-episode simulation, or launch the experiment suite; the simulation coordinates a physics environment and robot, which senses and plans before applying motion. A* supplies global guidance, while DWA scores local actions and can obtain adaptive weights from the fuzzy controller. Episodes produce performance metrics and JSON logs. The README documents optional rendering, video, noisy sensing, and scenario comparisons; some subsystem links rely on documentation because their implementation was not fully sampled.

Main entry points: [`src/simulation.py`](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/simulation.py) (Episode Orchestrator), [`src/environment.py`](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/environment.py) (Physics Environment), [`src/robot.py`](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/robot.py) (Robot And Sensors), [`src/dwa.py`](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/dwa.py) (DWA Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Simulation Runs"]
  node_single_entry["Single Run<br/>[simulation.py]"]
  node_simulation["Episode Orchestrator<br/>[simulation.py]"]
  node_configuration["Simulation Config<br/>[config.py]"]
end

subgraph group_world["World And Robot"]
  node_environment["Physics Environment<br/>[environment.py]"]
  node_robot["Robot And Sensors<br/>[robot.py]"]
  node_localization["Odometry Correction<br/>[localization.py]"]
  node_renderer["Renderer<br/>[renderer.py]"]
end

subgraph group_planning["Navigation Planning"]
  node_global_planner["A* Path Planner<br/>[a_star.py]"]
  node_local_planner["DWA Controller<br/>[dwa.py]"]
  node_fuzzy_weights["Fuzzy Weight Tuning"]
end

subgraph group_evaluation["Experiments And Output"]
  node_experiment_runner["Experiment Runner<br/>[experiments.py]"]
  node_scenario_setup["Scenario Setup<br/>[experiments.py]"]
  node_layouts["Map Layouts"]
  node_metrics["Episode Metrics<br/>[simulation.py]"]
  node_experiment_log["Experiment Log"]
end

node_user(("Researcher"))

node_user -->|"starts run"| node_single_entry
node_user -->|"starts suite"| node_experiment_runner
node_single_entry -->|"launches"| node_simulation
node_experiment_runner -->|"selects scenarios"| node_scenario_setup
node_experiment_runner -->|"runs episodes"| node_simulation
node_scenario_setup -.->|"uses layouts"| node_layouts
node_simulation -->|"runs episode"| node_environment
node_environment -->|"creates robot"| node_robot
node_environment -->|"configures rendering"| node_renderer
node_environment -->|"reads settings"| node_configuration
node_robot -->|"corrects odometry"| node_localization
node_robot -->|"requests action"| node_local_planner
node_local_planner -->|"plans reference path"| node_global_planner
node_local_planner -->|"computes weights"| node_fuzzy_weights
node_simulation -->|"computes metrics"| node_metrics
node_simulation -->|"appends results"| node_experiment_log

click node_single_entry "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/simulation.py"
click node_experiment_runner "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/experiments.py"
click node_scenario_setup "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/experiments.py"
click node_simulation "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/simulation.py"
click node_configuration "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/config.py"
click node_environment "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/environment.py"
click node_robot "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/robot.py"
click node_localization "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/localization.py"
click node_global_planner "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/a_star.py"
click node_local_planner "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/dwa.py"
click node_fuzzy_weights "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/fuzzy_controller.py"
click node_renderer "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/renderer.py"
click node_layouts "https://github.com/lukmanharahap/fuzzy-dwa/tree/main/layouts"
click node_metrics "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/simulation.py"
click node_experiment_log "https://github.com/lukmanharahap/fuzzy-dwa/blob/main/results/experiments_log.json"

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_single_entry,node_simulation,node_configuration toneBlue
class node_environment,node_robot,node_localization,node_renderer toneAmber
class node_global_planner,node_local_planner,node_fuzzy_weights toneMint
class node_experiment_runner,node_scenario_setup,node_layouts,node_metrics,node_experiment_log toneRose
class node_user toneIndigo
```

## Components

### Simulation Runs

- [Single Run](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/simulation.py): `src/simulation.py`
- [Episode Orchestrator](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/simulation.py): `src/simulation.py`
- [Simulation Config](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/config.py): `src/config.py`

### World And Robot

- [Physics Environment](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/environment.py): `src/environment.py`
- [Robot And Sensors](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/robot.py): `src/robot.py`
- [Odometry Correction](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/localization.py): `src/localization.py`
- [Renderer](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/renderer.py): `src/renderer.py`

### Navigation Planning

- [A* Path Planner](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/a_star.py): `src/a_star.py`
- [DWA Controller](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/dwa.py): `src/dwa.py`
- [Fuzzy Weight Tuning](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/fuzzy_controller.py): `src/fuzzy_controller.py`

### Experiments And Output

- [Experiment Runner](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/experiments.py): `experiments.py`
- [Scenario Setup](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/experiments.py): `experiments.py`
- [Map Layouts](https://github.com/lukmanharahap/fuzzy-dwa/tree/main/layouts): `layouts`
- [Episode Metrics](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/src/simulation.py): `src/simulation.py`
- [Experiment Log](https://github.com/lukmanharahap/fuzzy-dwa/blob/main/results/experiments_log.json): `results/experiments_log.json`

### Other components

- **Researcher**

## Connections

- Researcher → Single Run: starts run (evidence: `README.md`)
- Researcher → Experiment Runner: starts suite (evidence: `README.md`)
- Single Run → Episode Orchestrator: launches (evidence: `run_simulation.py`)
- Experiment Runner → Scenario Setup: selects scenarios (evidence: `experiments.py`)
- Experiment Runner → Episode Orchestrator: runs episodes (evidence: `experiments.py`)
- Scenario Setup → Map Layouts: uses layouts (evidence: `README.md`)
- Episode Orchestrator → Physics Environment: runs episode (evidence: `README.md`)
- Physics Environment → Robot And Sensors: creates robot (evidence: `src/environment.py`)
- Physics Environment → Renderer: configures rendering (evidence: `src/environment.py`)
- Physics Environment → Simulation Config: reads settings (evidence: `src/environment.py`)
- Robot And Sensors → Odometry Correction: corrects odometry (evidence: `src/robot.py`)
- Robot And Sensors → DWA Controller: requests action (evidence: `src/robot.py`)
- DWA Controller → A* Path Planner: plans reference path (evidence: `src/dwa.py`)
- DWA Controller → Fuzzy Weight Tuning: computes weights (evidence: `src/dwa.py`)
- Episode Orchestrator → Episode Metrics: computes metrics (evidence: `README.md`)
- Episode Orchestrator → Experiment Log: appends results (evidence: `README.md`)
