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