- 30 déc., 2025 4 validations
-
-
Hamadou Ba a écrit
Add Pydantic models for API validation and 5 project scenarios Pydantic Models: - models/config.py: SimulationConfigModel with full validation - ServerConfig for each server in the network - Probability conservation validation - Conversion to internal SimulationConfig - models/results.py: Complete results models for API responses - QueueStatisticsModel per queue - TimeSeriesDataModel for evolution tracking - HistogramDataModel for processing time distribution - SimulationResultsModel with all metrics Predefined Scenarios: - scenarios.py: 5 scenarios from project requirements - Scenario 1: 1 fast server (120ms) - instability test - Scenario 2: 1 fast + 1 slow server (120ms/240ms) - Scenario 3: 3 slow servers (240ms each) - Scenario 4: 1 fast + 1 medium (120ms/190ms) - compare with scenario 3 - Scenario 5: Parameter sensitivity (vary λ and p) - Theoretical utilization calculations for each scenario - Scenario registry for easy access - list_scenarios() function for API Testing: - test_all_scenarios.py: Comprehensive test of all scenarios - Runs all 5 scenarios with variations - Compares theoretical vs simulation results - Summary table for performance comparison Results Analysis: - All scenarios execute successfully - Stable systems show ρ < 1 as expected - Some scenarios show slight instability (ρ ≈ 1.0) due to high load - Parameter sensitivity variations demonstrate impact of λ and p Phase 3 Complete ✓ Next: Phase 4 - Analytical module (Jackson's theorem)
-
Hamadou Ba a écrit
Implement event-driven discrete simulation for queueing networks Core Components: - events.py: Event and EventType for discrete event simulation - Priority queue ordering by time - ARRIVAL and SERVICE_END event types - request.py: Request entity with full visit tracking - QueueVisit records for each queue visited - Automatic calculation of wait/service/system times - Journey tracking through network - random_utils.py: Random number generation - Exponential distribution (inverse transform method) - Probabilistic choice for routing decisions - Seed control for reproducibility - queues.py: M/M/1 Queue implementation - FIFO discipline with single server - Complete statistics collection (utilization, avg times) - Exponential service times - router.py: Probabilistic routing logic - Route from coordinator: exit (p) or server (qi) - Route from server: always return to coordinator - Probability conservation validation - simulation.py: Main event-driven simulator - Priority queue (heapq) for event scheduling - Warmup period to reach steady state - Complete statistics generation - Support for multiple servers Testing: - test_random_utils.py: Validate exponential distribution (mean, reproducibility) - test_simulation.py: End-to-end simulation tests - Stable and unstable systems - Multiple servers - Reproducibility with seeds Demo: - demo_simulation.py: Scenario 1 demonstration (1 fast server) - Theoretical vs simulation comparison - All 14 tests passing ✓ Phase 2 Complete ✓ Next: Phase 3 - Statistics collection and multi-server scenarios
-
Hamadou Ba a écrit
Initialize Turborepo monorepo with Python backend and React frontend - Setup Turborepo configuration with workspaces - Configure Python FastAPI backend - Create project structure (core, analytics, api, models) - Add requirements.txt with FastAPI, Uvicorn, Pydantic, etc. - Basic FastAPI app with health endpoints - CORS middleware for frontend integration - Configure React + TypeScript + Vite frontend - Install dependencies (Chart.js, D3.js, Zustand, Axios) - Setup Tailwind CSS with PostCSS - Create component directory structure - Basic landing page with Tailwind styling - Add comprehensive README files - Configure .gitignore for Python and Node.js Phase 1 Complete ✓ Next: Phase 2 - Core simulation engine implementation
-
Hamadou Ba a écrit
-