How felipe783/problema_papai-noel works
This repository implements a finite Santa Claus synchronization simulation in C/pthreads, with a separate infinite, interactive variant. The main workflow parses a run configuration, starts Noel, elf and reindeer threads, resolves group-help versus reindeer-trip requests, then computes metrics and exports CSVs. The README also documents experiment and graph-generation capabilities. The graph includes the infinite variant’s runtime and web interface; its server-to-simulator wiring is not shown in the sampled source, so that relationship is marked unverified.
Main entry points: src/main.c Run coordinator · src/main.c Infinite coordinator · src/noel.c Noel decisions · src/noel.c Infinite Noel decisions
Components 21
Finite Simulation
- Run coordinator
src/main.c - Shared state
src/comum.h - Elf threads
src/elfo.c - Reindeer threads
src/rena.c - Noel decisions
src/noel.c - Monotonic timing
src/tempo.c - Run metrics
src/metricas.c - CSV export
src/csv.c
Experiment Analysis
- Run CSV files
dados - Experiment runs
scripts/run_experimentos.sh - Charts and wait table
scripts/graficos.py
Infinite Simulation
- Infinite coordinator
papai_noel_infinito/src/main.c - Infinite shared state
papai_noel_infinito/src/comum.h - Infinite elf threads
papai_noel_infinito/src/elfo.c - Infinite reindeer threads
papai_noel_infinito/src/rena.c - Infinite Noel decisions
papai_noel_infinito/src/noel.c - Virtual clock
papai_noel_infinito/src/relogio.c - JSON event output
papai_noel_infinito/src/saida.c
Live Interface
- Web event server
papai_noel_infinito/servidor.py - Browser interface
papai_noel_infinito/web/app.js
Other components
- Run operator
Connections 25
- Run operator → Run coordinator: configures run
README.md - Run coordinator → Shared state: initializes state
src/main.c - Run coordinator → Elf threads: creates threads
src/main.c - Run coordinator → Reindeer threads: creates threads
src/main.c - Run coordinator → Noel decisions: creates thread
src/main.c - Run coordinator → Monotonic timing: uses timing
src/main.c - Noel decisions → Shared state: checks and updates
src/noel.c - Noel decisions → Monotonic timing: simulates work
src/noel.c - Run coordinator → Run metrics: calculates after joins
src/main.c - Run coordinator → CSV export: exports results
src/main.c - CSV export → Run CSV files: appends CSVs
README.md - Run operator → Experiment runs: runs experiments
README.md - Experiment runs → Run coordinator: runs configurations
README.md - Run operator → Charts and wait table: generates charts
README.md - Charts and wait table → Run CSV files: reads results
README.md - Run operator → Infinite coordinator: starts simulation
README.md - Infinite coordinator → Infinite shared state: initializes state
papai_noel_infinito/src/main.c - Infinite coordinator → Infinite Noel decisions: creates thread
papai_noel_infinito/src/main.c - Infinite coordinator → Infinite elf threads: creates threads
papai_noel_infinito/src/main.c - Infinite coordinator → Infinite reindeer threads: creates threads
papai_noel_infinito/src/main.c - Infinite coordinator → Virtual clock: controls time
papai_noel_infinito/src/main.c - Infinite Noel decisions → Virtual clock: sleeps for work
papai_noel_infinito/src/noel.c - Infinite Noel decisions → JSON event output: emits events
papai_noel_infinito/src/noel.c - JSON event output → Web event server: streams events
- Web event server → Browser interface: feeds interface