# pancho1998-sys/pasapalabra architecture

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

- Interactive diagram: https://gitdiagram.com/pancho1998-sys/pasapalabra
- Repository: https://github.com/pancho1998-sys/pasapalabra

## Overview

AE2 is a discrete operating-system simulator for process scheduling and contiguous memory management. A user configures memory and the CPU quantum, registers processes, then advances the simulation with ticks. The simulator admits processes when memory is available, coordinates Round-Robin execution and I/O blocking, releases memory on completion, and exposes snapshots and metrics. The README documents these capabilities; the graph’s implementation relationships are based on the sampled source, so unsampled details are not expanded.

Main entry points: [`src/simulator.ts`](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/simulator.ts) (Simulation engine), [`src/process.ts`](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/process.ts) (Process control), [`src/memory-manager.ts`](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/memory-manager.ts) (Contiguous memory), [`src/scheduler.ts`](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/scheduler.ts) (Round-Robin scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Simulation runtime"]
  node_simulator["Simulation engine<br/>[simulator.ts]"]
  node_scheduler["Round-Robin scheduler<br/>[scheduler.ts]"]
end

subgraph group_process["Process lifecycle"]
  node_process["Process control<br/>[process.ts]"]
  node_states["Process states<br/>[enums.ts]"]
end

subgraph group_memory["Memory management"]
  node_memory_manager["Contiguous memory<br/>[memory-manager.ts]"]
  node_memory_block["Memory blocks<br/>[memory-block.ts]"]
end

subgraph group_insight["State and metrics"]
  node_metrics["Metrics calculator<br/>[metrics.ts]"]
  node_interfaces["Domain contracts<br/>[interfaces.ts]"]
end

node_user(("User"))

node_user -->|"configures and advances"| node_simulator
node_simulator -->|"allocates and releases"| node_memory_manager
node_simulator -->|"dispatches and rotates"| node_scheduler
node_simulator -->|"creates and transitions"| node_process
node_simulator -->|"calculates metrics"| node_metrics
node_simulator -->|"checks process state"| node_states
node_memory_manager -->|"splits and coalesces"| node_memory_block
node_scheduler -->|"dispatches and executes"| node_process
node_process -->|"transitions between"| node_states
node_metrics -->|"reads memory totals"| node_memory_manager
node_simulator -->|"returns snapshots and metrics"| node_interfaces

click node_simulator "https://github.com/pancho1998-sys/pasapalabra/blob/main/src/simulator.ts"
click node_scheduler "https://github.com/pancho1998-sys/pasapalabra/blob/main/src/scheduler.ts"
click node_process "https://github.com/pancho1998-sys/pasapalabra/blob/main/src/process.ts"
click node_states "https://github.com/pancho1998-sys/pasapalabra/blob/main/src/enums.ts"
click node_memory_manager "https://github.com/pancho1998-sys/pasapalabra/blob/main/src/memory-manager.ts"
click node_memory_block "https://github.com/pancho1998-sys/pasapalabra/blob/main/src/memory-block.ts"
click node_metrics "https://github.com/pancho1998-sys/pasapalabra/blob/main/src/metrics.ts"
click node_interfaces "https://github.com/pancho1998-sys/pasapalabra/blob/main/src/interfaces.ts"

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_simulator,node_scheduler,node_user toneBlue
class node_process,node_states toneAmber
class node_memory_manager,node_memory_block toneMint
class node_metrics,node_interfaces toneRose
```

## Components

### Simulation runtime

- [Simulation engine](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/simulator.ts): `src/simulator.ts`
- [Round-Robin scheduler](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/scheduler.ts): `src/scheduler.ts`

### Process lifecycle

- [Process control](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/process.ts): `src/process.ts`
- [Process states](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/enums.ts): `src/enums.ts`

### Memory management

- [Contiguous memory](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/memory-manager.ts): `src/memory-manager.ts`
- [Memory blocks](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/memory-block.ts): `src/memory-block.ts`

### State and metrics

- [Metrics calculator](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/metrics.ts): `src/metrics.ts`
- [Domain contracts](https://github.com/pancho1998-sys/pasapalabra/blob/main/src/interfaces.ts): `src/interfaces.ts`

### Other components

- **User**

## Connections

- User → Simulation engine: configures and advances (evidence: `README.md`)
- Simulation engine → Contiguous memory: allocates and releases (evidence: `src/simulator.ts`)
- Simulation engine → Round-Robin scheduler: dispatches and rotates (evidence: `src/simulator.ts`)
- Simulation engine → Process control: creates and transitions (evidence: `src/simulator.ts`)
- Simulation engine → Metrics calculator: calculates metrics (evidence: `src/simulator.ts`)
- Simulation engine → Process states: checks process state (evidence: `src/simulator.ts`)
- Contiguous memory → Memory blocks: splits and coalesces (evidence: `src/memory-manager.ts`)
- Round-Robin scheduler → Process control: dispatches and executes (evidence: `src/scheduler.ts`)
- Process control → Process states: transitions between (evidence: `src/process.ts`)
- Metrics calculator → Contiguous memory: reads memory totals (evidence: `src/metrics.ts`)
- Simulation engine → Domain contracts: returns snapshots and metrics (evidence: `src/simulator.ts`)
