# rikonenobais/deepq-mobileedgecomputing-modified architecture

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

- Interactive diagram: https://gitdiagram.com/rikonenobais/deepq-mobileedgecomputing-modified
- Repository: https://github.com/rikonenobais/deepq-mobileedgecomputing-modified

## Overview

This research code trains deep-Q-learning agents to offload mobile-device tasks in a simulated edge-computing environment. A researcher starts either training script; the script creates per-device agents, runs episodes against the environment, and collects reward, cost, delay, and task-drop metrics. The environment models local computation, wireless transmission, fog computation, and queues; agents select actions and learn from transitions. The README identifies the scripts’ roles, while sampled excerpts do not show the full episode interface or how results are ultimately persisted.

Main entry points: [`train.py`](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/train.py) (Main training), [`trainPaperParam.py`](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/trainPaperParam.py) (Paper parameters), [`fog_env.py`](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/fog_env.py) (Offload environment), [`RL_brain.py`](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/RL_brain.py) (DQN agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Training"]
  node_train_main["Main training<br/>[train.py]"]
  node_train_params["Paper parameters<br/>[trainPaperParam.py]"]
  node_episode_metrics["Episode metrics<br/>[train.py]"]
end

subgraph group_simulation["Simulation"]
  node_environment["Offload environment<br/>[fog_env.py]"]
  node_task_queues["Task queues<br/>[fog_env.py]"]
  node_offload_model["Offload simulation<br/>[fog_env.py]"]
end

subgraph group_learning["Learning"]
  node_dqn_agent["DQN agent<br/>[RL_brain.py]"]
  node_replay_memory[("Replay memory<br/>[RL_brain.py]")]
  node_q_network["Recurrent Q network<br/>[RL_brain.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"starts training"| node_train_main
node_researcher -->|"starts experiment"| node_train_params
node_train_main -->|"runs episodes"| node_environment
node_train_params -->|"runs episodes"| node_environment
node_train_main -->|"creates and learns"| node_dqn_agent
node_train_params -->|"creates and learns"| node_dqn_agent
node_environment -->|"simulates tasks"| node_offload_model
node_offload_model -->|"queues tasks"| node_task_queues
node_task_queues -->|"feeds processing"| node_offload_model
node_environment -->|"returns episode state"| node_train_main
node_environment -->|"returns episode state"| node_train_params
node_train_main -->|"aggregates outcomes"| node_episode_metrics
node_train_params -->|"aggregates outcomes"| node_episode_metrics
node_dqn_agent -->|"selects and updates"| node_q_network
node_dqn_agent -->|"stores transitions"| node_replay_memory
node_replay_memory -->|"supplies batches"| node_dqn_agent

click node_train_main "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/train.py"
click node_train_params "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/trainPaperParam.py"
click node_episode_metrics "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/train.py"
click node_environment "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/fog_env.py"
click node_task_queues "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/fog_env.py"
click node_offload_model "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/fog_env.py"
click node_dqn_agent "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/RL_brain.py"
click node_replay_memory "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/RL_brain.py"
click node_q_network "https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/RL_brain.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_train_main,node_train_params,node_episode_metrics toneBlue
class node_environment,node_task_queues,node_offload_model toneAmber
class node_dqn_agent,node_replay_memory,node_q_network toneMint
class node_researcher toneIndigo
```

## Components

### Training

- [Main training](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/train.py): `train.py`
- [Paper parameters](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/trainPaperParam.py): `trainPaperParam.py`
- [Episode metrics](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/train.py): `train.py`

### Simulation

- [Offload environment](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/fog_env.py): `fog_env.py`
- [Task queues](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/fog_env.py): `fog_env.py`
- [Offload simulation](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/fog_env.py): `fog_env.py`

### Learning

- [DQN agent](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/RL_brain.py): `RL_brain.py`
- [Replay memory](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/RL_brain.py): `RL_brain.py`
- [Recurrent Q network](https://github.com/rikonenobais/deepq-mobileedgecomputing-modified/blob/main/RL_brain.py): `RL_brain.py`

### Other components

- **Researcher**

## Connections

- Researcher → Main training: starts training
- Researcher → Paper parameters: starts experiment
- Main training → Offload environment: runs episodes
- Paper parameters → Offload environment: runs episodes
- Main training → DQN agent: creates and learns
- Paper parameters → DQN agent: creates and learns
- Offload environment → Offload simulation: simulates tasks
- Offload simulation → Task queues: queues tasks
- Task queues → Offload simulation: feeds processing
- Offload environment → Main training: returns episode state
- Offload environment → Paper parameters: returns episode state
- Main training → Episode metrics: aggregates outcomes
- Paper parameters → Episode metrics: aggregates outcomes
- DQN agent → Recurrent Q network: selects and updates
- DQN agent → Replay memory: stores transitions
- Replay memory → DQN agent: supplies batches
