using RobotNet10.FleetManager.Shared.Enums; namespace RobotNet10.FleetManager.Services.TrafficControl.Models; /// /// Configuration for TrafficControl service /// public class TrafficControlConfig { /// /// Conflict detection configuration /// public ConflictDetectionConfig ConflictDetection { get; set; } = new(); /// /// Base/Horizon management configuration /// public BaseHorizonConfig BaseHorizon { get; set; } = new(); /// /// Conflict resolution configuration /// public ConflictResolutionConfig ConflictResolution { get; set; } = new(); /// /// Priority configuration /// public PriorityConfig Priority { get; set; } = new(); /// /// Path planning configuration /// public PathPlanningConfig PathPlanning { get; set; } = new(); } /// /// Conflict detection configuration /// public class ConflictDetectionConfig { /// /// Detection interval in milliseconds (default: 500ms = 2 Hz) /// public int IntervalMs { get; set; } = 500; /// /// Vertex conflict threshold in meters (default: 2.0m) /// public double VertexConflictThreshold { get; set; } = 2.0; /// /// Minimum safe distance for proximity conflict in meters (default: 1.0m) /// public double ProximityMinDistance { get; set; } = 1.0; /// /// Time conflict threshold in seconds (default: 5.0s) /// public double TimeConflictThreshold { get; set; } = 5.0; /// /// Rotation space radius in meters (default: 0.5m) /// public double RotationSpaceRadius { get; set; } = 0.5; /// /// Corridor width threshold in meters (default: 2.0m) /// public double CorridorWidthThreshold { get; set; } = 2.0; } /// /// Base/Horizon management configuration /// public class BaseHorizonConfig { /// /// Initial number of base segments (default: 2) /// public int InitialBaseSegments { get; set; } = 2; /// /// Number of segments to release ahead (default: 2) /// public int ReleaseAheadSegments { get; set; } = 2; /// /// Minimum number of horizon segments to keep (default: 1) /// public int MinHorizonSegments { get; set; } = 1; } /// /// Conflict resolution configuration /// public class ConflictResolutionConfig { /// /// Maximum wait time at node in seconds (default: 5.0s) /// public double WaitTimeAtNode { get; set; } = 5.0; /// /// Whether to allow reroute on conflict (default: true) /// public bool RerouteOnConflict { get; set; } = true; /// /// Maximum reroute attempts for one conflict (default: 3) /// public int MaxRerouteAttempts { get; set; } = 3; /// /// Enable resolution optimization (default: true) /// public bool ResolutionOptimization { get; set; } = true; /// /// Maximum simulation depth for resolution evaluation (default: 2) /// public int MaxResolutionSimulationDepth { get; set; } = 2; } /// /// Priority configuration /// public class PriorityConfig { /// /// Default priority level (default: 0) /// public int DefaultPriority { get; set; } = 0; /// /// Emergency priority level (default: 100) /// public int EmergencyPriority { get; set; } = 100; /// /// High value order priority level (default: 50) /// public int HighValueOrderPriority { get; set; } = 50; /// /// Time critical priority level (default: 30) /// public int TimeCriticalPriority { get; set; } = 30; } /// /// Path planning configuration /// public class PathPlanningConfig { /// /// Mapping from NavigationType to PathPlanningMethod /// Defines which IPathPlanner method to use for each NavigationType /// public Dictionary NavigationTypeMethodMapping { get; set; } = new() { // Default mappings { NavigationType.Differential, PathPlanningMethod.Basic }, { NavigationType.Forklift, PathPlanningMethod.Basic }, { NavigationType.OmniDrive, PathPlanningMethod.Basic } }; /// /// Default path planning method if NavigationType is not found in mapping (default: Basic) /// public PathPlanningMethod DefaultMethod { get; set; } = PathPlanningMethod.Basic; }