How salah1892/smartplanif.blazoralns works
SmartPlanif is a Blazor application for allocating buses, drivers, and receivers to daily trips under configurable hard and soft constraints. Users configure policy or preview feasibility, then request an allocation: the application orchestrates data loading, phased construction, ALNS improvement, completion, and independent validation before presenting the plan and diagnostics. Infrastructure supports demo and MySQL data plus JSON settings. The README documents the main capabilities and layer direction; several UI and persistence connections are therefore documented or left unverified because their implementation was not excerpted.
Main entry points: AllocateDay.cs Allocate day · DependencyInjection.cs Infrastructure wiring · SmartPlanif.Web Blazor UI · TripAllocator.cs Trip allocator
Components 25
Web interface
- Blazor UI
src/SmartPlanif.Web - UI support
src/SmartPlanif.Web/Services/UiSupport.cs
Application use cases
- Allocate day
src/SmartPlanif.Application/UseCases/AllocateDay.cs - Preview feasibility
src/SmartPlanif.Application/UseCases/PreviewDay.cs - Settings service
src/SmartPlanif.Application/UseCases/AllocationSettingsService.cs - Repository ports
src/SmartPlanif.Application/Abstractions/Ports.cs
Allocation domain
- Allocation policy
src/SmartPlanif.Domain/Allocation/AllocationPolicy.cs - Constraint catalog
src/SmartPlanif.Domain/Constraints/ConstraintCatalog.cs - Trip allocator
src/SmartPlanif.Domain/Allocation/TripAllocator.cs - Feasibility analysis
src/SmartPlanif.Domain/Allocation/FeasibilityAnalyzer.cs - Hard and soft rules
src/SmartPlanif.Domain/Rules - Plan state
src/SmartPlanif.Domain/Allocation/AllocationState.cs - Resource schedules
src/SmartPlanif.Domain/Scheduling/ScheduleBook.cs - ALNS improver
src/SmartPlanif.Domain/Alns/AlnsImprover.cs - Plan objective
src/SmartPlanif.Domain/Allocation/ObjectiveFunction.cs - Plan completion
src/SmartPlanif.Domain/Allocation/PlanCompleter.cs - Plan validation
src/SmartPlanif.Domain/Allocation/PlanValidator.cs
Data infrastructure
- Demo data
src/SmartPlanif.Infrastructure/InMemory/DemoDataStore.cs - MySQL trip data
src/SmartPlanif.Infrastructure/MySql/MySqlTripRepository.cs - MySQL resources
src/SmartPlanif.Infrastructure/MySql/MySqlResourceRepository.cs - MySQL assignments
src/SmartPlanif.Infrastructure/MySql/MySqlAssignmentRepository.cs - MySQL reference data
src/SmartPlanif.Infrastructure/MySql/MySqlReferenceDataRepository.cs - JSON settings store
src/SmartPlanif.Infrastructure/Settings/JsonAllocationSettingsStore.cs - Infrastructure wiring
src/SmartPlanif.Infrastructure/DependencyInjection.cs
Other components
- Planner user
Connections 36
- Planner user → Blazor UI: configures and requests
README.md - Blazor UI → Allocate day: requests allocation
- Blazor UI → Preview feasibility: requests preview
- Blazor UI → Settings service: edits settings
- Allocate day → Repository ports: loads and saves data
src/SmartPlanif.Application/UseCases/AllocateDay.cs - Preview feasibility → Repository ports: loads preview data
- Settings service → Repository ports: uses settings port
src/SmartPlanif.Application/UseCases/AllocationSettingsService.cs - Settings service → Allocation policy: validates policy
src/SmartPlanif.Application/UseCases/AllocationSettingsService.cs - Allocate day → Feasibility analysis: diagnoses feasibility
src/SmartPlanif.Application/UseCases/AllocateDay.cs - Preview feasibility → Feasibility analysis: analyzes feasibility
src/SmartPlanif.Application/UseCases/PreviewDay.cs - Allocate day → Trip allocator: constructs allocation
src/SmartPlanif.Application/UseCases/AllocateDay.cs - Allocate day → Plan state: builds plan state
src/SmartPlanif.Application/UseCases/AllocateDay.cs - Allocate day → ALNS improver: improves plan
src/SmartPlanif.Application/UseCases/AllocateDay.cs - Allocate day → Plan completion: completes plan
src/SmartPlanif.Application/UseCases/AllocateDay.cs - Allocate day → Plan validation: validates result
src/SmartPlanif.Application/UseCases/AllocateDay.cs - Trip allocator → Constraint catalog: builds rule sets
src/SmartPlanif.Domain/Allocation/TripAllocator.cs - Constraint catalog → Hard and soft rules: creates configured rules
src/SmartPlanif.Domain/Constraints/ConstraintCatalog.cs - Trip allocator → Resource schedules: checks and commits
src/SmartPlanif.Domain/Allocation/TripAllocator.cs - ALNS improver → Trip allocator: repairs candidates
src/SmartPlanif.Domain/Alns/AlnsImprover.cs - ALNS improver → Plan objective: scores candidates
src/SmartPlanif.Domain/Alns/AlnsImprover.cs - ALNS improver → Plan state: copies and improves
src/SmartPlanif.Domain/Alns/AlnsImprover.cs - Plan completion → Trip allocator: assigns remaining trips
src/SmartPlanif.Domain/Allocation/PlanCompleter.cs - Allocate day → Demo data: loads demo data
- Allocate day → MySQL trip data: loads trip data
- Allocate day → MySQL resources: loads resources
- Allocate day → MySQL assignments: loads assignments
- Allocate day → MySQL reference data: loads reference data
- Settings service → JSON settings store: persists policy
- Infrastructure wiring → Demo data: registers demo store
src/SmartPlanif.Infrastructure/DependencyInjection.cs - Infrastructure wiring → MySQL trip data: registers repository
src/SmartPlanif.Infrastructure/DependencyInjection.cs - Infrastructure wiring → MySQL resources: registers repository
src/SmartPlanif.Infrastructure/DependencyInjection.cs - Infrastructure wiring → MySQL assignments: registers repository
src/SmartPlanif.Infrastructure/DependencyInjection.cs - Infrastructure wiring → MySQL reference data: registers repository
src/SmartPlanif.Infrastructure/DependencyInjection.cs - Infrastructure wiring → JSON settings store: registers store
src/SmartPlanif.Infrastructure/DependencyInjection.cs - Infrastructure wiring → Repository ports: implements ports
src/SmartPlanif.Infrastructure/DependencyInjection.cs - Blazor UI → UI support: uses UI helpers