using System;
using MultiWheelC.TrajectoryPlanning.CoarsePath;
using MultiWheelC.TrajectoryPlanning.Mapping;
using MultiWheelC.TrajectoryPlanning.PathSmoothing.Processing;

namespace MultiWheelC.TrajectoryPlanning.PathSmoothing.Algorithms;

/// <summary>单次算法运行共享的已预处理路径和独立复核上下文。</summary>
internal sealed class SmoothingAlgorithmInput
{
    internal SmoothingAlgorithmInput(
        PreparedPath originalPath,
        PlanningGridMap map,
        VehicleParameters vehicle,
        double maximumCollisionCheckStepMeters,
        double minimumClearanceReserveMeters,
        SmoothingOptionsSnapshot options)
    {
        OriginalPath = originalPath ?? throw new ArgumentNullException(nameof(originalPath));
        Map = map ?? throw new ArgumentNullException(nameof(map));
        Vehicle = vehicle ?? throw new ArgumentNullException(nameof(vehicle));
        MaximumCollisionCheckStepMeters = maximumCollisionCheckStepMeters;
        MinimumClearanceReserveMeters = minimumClearanceReserveMeters;
        Options = options ?? throw new ArgumentNullException(nameof(options));
    }

    /// <summary>已校验并按方向分段的原始路径。</summary>
    internal PreparedPath OriginalPath { get; }

    /// <summary>用于完整车体复核的不可变规划地图。</summary>
    internal PlanningGridMap Map { get; }

    /// <summary>用于曲率和足迹复核的车辆参数快照。</summary>
    internal VehicleParameters Vehicle { get; }

    /// <summary>连续车体碰撞检查的最大步长，单位 m。</summary>
    internal double MaximumCollisionCheckStepMeters { get; }

    /// <summary>候选几何必须从原始保守净空中预留的最小安全余量，单位 m。</summary>
    internal double MinimumClearanceReserveMeters { get; }

    /// <summary>本次算法运行使用的已验证方法选项快照。</summary>
    internal SmoothingOptionsSnapshot Options { get; }
}
