# anshhhgupta/raae----resource-aware-adaptive-app-eviction architecture

> Architecture diagram of the GitHub repository anshhhgupta/raae----resource-aware-adaptive-app-eviction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction
- Repository: https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction

## Overview

RAAE is a resource-aware operating-system simulation: users manage simulated apps and resources, run stepwise or comparative workloads, and inspect eviction decisions and analytics. Its central path is simulation control through the eviction policy: Clock selects a candidate, RAAE checks resource conflicts and releases resources safely before eviction. The graph also preserves the documented app-management, resource-management, dashboard, and analytics capabilities. Some UI and analytics wiring is supported by the SOURCE INDEX or README rather than sampled implementation excerpts; uncertain links are omitted.

Main entry points: [`backend/simulation_engine/controller.py`](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation_engine/controller.py) (Simulation Controller), [`app.py`](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/app.py) (Application Entry), [`backend/memory_manager/memory_manager.py`](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/memory_manager/memory_manager.py) (Memory Manager), [`backend/resource_manager/resource_manager.py`](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/resource_manager/resource_manager.py) (Resource Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User Interface"]
  node_app["Application Entry<br/>[app.py]"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_appcontrols["App Controls<br/>[app_controls.py]"]
  node_appactions["App Actions<br/>[app_actions.py]"]
  node_resourceview["Resource View<br/>[resource_view.py]"]
  node_resourceactions["Resource Actions"]
  node_simview["Simulation View<br/>[simulation_view.py]"]
  node_session["Simulation Session"]
  node_analyticsview["Analytics View<br/>[analytics_view.py]"]
end

subgraph group_sim["Simulation"]
  node_workload["Workload Generator"]
  node_controller["Simulation Controller<br/>[controller.py]"]
  node_engine["Simulation Engine"]
  node_simstate["Simulation State"]
end

subgraph group_managers["System Managers"]
  node_memory["Memory Manager<br/>[memory_manager.py]"]
  node_resources["Resource Manager"]
  node_models["App And Resource Models<br/>[app.py]"]
end

subgraph group_decision["Eviction Decision"]
  node_policy["Eviction Policies<br/>[policies.py]"]
  node_raae["RAAE Engine<br/>[raae_engine.py]"]
  node_conflict["Conflict Adapter"]
  node_woundwait["Wound-Wait Resolver"]
end

subgraph group_data["Persistence And Analytics"]
  node_database[("SQLite Database<br/>[db.py]")]
  node_repositories["Data Repositories<br/>[repositories.py]"]
  node_analytics["Historical Analytics<br/>[analytics.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_appcontrols
node_app -->|"routes to"| node_simview
node_app -->|"routes to"| node_resourceview
node_app -->|"routes to"| node_analyticsview
node_appcontrols -->|"uses"| node_appactions
node_resourceview -->|"uses"| node_resourceactions
node_simview -->|"uses"| node_session
node_analyticsview -->|"reads results"| node_controller
node_analyticsview -->|"uses"| node_workload
node_controller -.->|"loads workload"| node_workload
node_controller -->|"initializes"| node_memory
node_controller -->|"initializes"| node_resources
node_controller -->|"persists events"| node_database
node_controller -->|"runs"| node_engine
node_session -->|"controls"| node_controller
node_engine -->|"evaluates candidate"| node_policy
node_engine -->|"selects candidate"| node_memory
node_policy -->|"executes safe eviction"| node_raae
node_raae -->|"checks conflicts"| node_conflict
node_conflict -->|"delegates resolution"| node_woundwait
node_raae -.->|"releases safely"| node_resources
node_policy -.->|"evicts candidate"| node_memory
node_simstate -->|"delegates memory"| node_memory
node_simstate -->|"delegates locks"| node_resources
node_memory -->|"updates app state"| node_models
node_resources -->|"tracks ownership"| node_models
node_database -->|"delegates queries"| node_repositories
node_database -->|"exposes analytics"| node_analytics

click node_app "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/app.py"
click node_dashboard "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/dashboard.py"
click node_appcontrols "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/app_controls.py"
click node_appactions "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/app_actions.py"
click node_resourceview "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/resource_view.py"
click node_resourceactions "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/resource_actions.py"
click node_simview "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/simulation_view.py"
click node_session "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/simulation_session.py"
click node_analyticsview "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/analytics_view.py"
click node_workload "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/workload_generator/workload_generator.py"
click node_controller "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation_engine/controller.py"
click node_engine "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation_engine/simulation_engine.py"
click node_simstate "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation/simulation_state.py"
click node_memory "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/memory_manager/memory_manager.py"
click node_resources "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/resource_manager/resource_manager.py"
click node_models "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/models/app.py"
click node_policy "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation_engine/policies.py"
click node_raae "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/raae_engine/raae_engine.py"
click node_conflict "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/raae_engine/conflict_manager.py"
click node_woundwait "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/conflict_manager/conflict_manager.py"
click node_database "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/database/db.py"
click node_repositories "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/database/repositories.py"
click node_analytics "https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/database/analytics.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_app,node_dashboard,node_appcontrols,node_appactions,node_resourceview,node_resourceactions,node_simview,node_session,node_analyticsview,node_user toneBlue
class node_workload,node_controller,node_engine,node_simstate toneAmber
class node_memory,node_resources,node_models toneMint
class node_policy,node_raae,node_conflict,node_woundwait toneRose
class node_database,node_repositories,node_analytics toneIndigo
```

## Components

### User Interface

- [Application Entry](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/app.py): `app.py`
- [Dashboard](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/dashboard.py): `ui/dashboard.py`
- [App Controls](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/app_controls.py): `ui/app_controls.py`
- [App Actions](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/app_actions.py): `ui/app_actions.py`
- [Resource View](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/resource_view.py): `ui/resource_view.py`
- [Resource Actions](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/resource_actions.py): `ui/resource_actions.py`
- [Simulation View](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/simulation_view.py): `ui/simulation_view.py`
- [Simulation Session](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/simulation_session.py): `ui/simulation_session.py`
- [Analytics View](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/ui/analytics_view.py): `ui/analytics_view.py`

### Simulation

- [Workload Generator](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/workload_generator/workload_generator.py): `backend/workload_generator/workload_generator.py`
- [Simulation Controller](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation_engine/controller.py): `backend/simulation_engine/controller.py`
- [Simulation Engine](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation_engine/simulation_engine.py): `backend/simulation_engine/simulation_engine.py`
- [Simulation State](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation/simulation_state.py): `backend/simulation/simulation_state.py`

### System Managers

- [Memory Manager](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/memory_manager/memory_manager.py): `backend/memory_manager/memory_manager.py`
- [Resource Manager](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/resource_manager/resource_manager.py): `backend/resource_manager/resource_manager.py`
- [App And Resource Models](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/models/app.py): `backend/models/app.py`

### Eviction Decision

- [Eviction Policies](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/simulation_engine/policies.py): `backend/simulation_engine/policies.py`
- [RAAE Engine](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/raae_engine/raae_engine.py): `backend/raae_engine/raae_engine.py`
- [Conflict Adapter](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/raae_engine/conflict_manager.py): `backend/raae_engine/conflict_manager.py`
- [Wound-Wait Resolver](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/backend/conflict_manager/conflict_manager.py): `backend/conflict_manager/conflict_manager.py`

### Persistence And Analytics

- [SQLite Database](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/database/db.py): `database/db.py`
- [Data Repositories](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/database/repositories.py): `database/repositories.py`
- [Historical Analytics](https://github.com/anshhhgupta/raae----resource-aware-adaptive-app-eviction/blob/main/database/analytics.py): `database/analytics.py`

### Other components

- **User**

## Connections

- User → Application Entry: uses
- Application Entry → Dashboard: routes to (evidence: `app.py`)
- Application Entry → App Controls: routes to (evidence: `app.py`)
- Application Entry → Simulation View: routes to (evidence: `app.py`)
- Application Entry → Resource View: routes to (evidence: `app.py`)
- Application Entry → Analytics View: routes to (evidence: `app.py`)
- App Controls → App Actions: uses (evidence: `ui/app_controls.py`)
- Resource View → Resource Actions: uses (evidence: `ui/resource_view.py`)
- Simulation View → Simulation Session: uses (evidence: `ui/simulation_view.py`)
- Analytics View → Simulation Controller: reads results (evidence: `ui/analytics_view.py`)
- Analytics View → Workload Generator: uses (evidence: `ui/analytics_view.py`)
- Simulation Controller → Workload Generator: loads workload
- Simulation Controller → Memory Manager: initializes (evidence: `backend/simulation_engine/controller.py`)
- Simulation Controller → Resource Manager: initializes (evidence: `backend/simulation_engine/controller.py`)
- Simulation Controller → SQLite Database: persists events (evidence: `backend/simulation_engine/controller.py`)
- Simulation Controller → Simulation Engine: runs (evidence: `backend/simulation_engine/controller.py`)
- Simulation Session → Simulation Controller: controls (evidence: `ui/simulation_session.py`)
- Simulation Engine → Eviction Policies: evaluates candidate (evidence: `backend/simulation_engine/simulation_engine.py`)
- Simulation Engine → Memory Manager: selects candidate (evidence: `backend/simulation_engine/simulation_engine.py`)
- Eviction Policies → RAAE Engine: executes safe eviction (evidence: `backend/simulation_engine/policies.py`)
- RAAE Engine → Conflict Adapter: checks conflicts (evidence: `backend/raae_engine/raae_engine.py`)
- Conflict Adapter → Wound-Wait Resolver: delegates resolution (evidence: `backend/raae_engine/conflict_manager.py`)
- RAAE Engine → Resource Manager: releases safely
- Eviction Policies → Memory Manager: evicts candidate (evidence: `backend/simulation_engine/policies.py`)
- Simulation State → Memory Manager: delegates memory (evidence: `backend/simulation/simulation_state.py`)
- Simulation State → Resource Manager: delegates locks (evidence: `backend/simulation/simulation_state.py`)
- Memory Manager → App And Resource Models: updates app state (evidence: `backend/memory_manager/memory_manager.py`)
- Resource Manager → App And Resource Models: tracks ownership (evidence: `backend/resource_manager/resource_manager.py`)
- SQLite Database → Data Repositories: delegates queries (evidence: `database/db.py`)
- SQLite Database → Historical Analytics: exposes analytics (evidence: `database/db.py`)
