Vda5050Settings.cs 2.28 KB
namespace Rcs.Domain.Settings;

/// <summary>
/// VDA5050 协议相关配置。
/// </summary>
public class Vda5050Settings
{
    /// <summary>
    /// 单次下发允许的最大路径节点数(含起点/终点,最小值为 2)。
    /// </summary>
    public int MaxDispatchNodeCount { get; set; } = 30;

    /// <summary>
    /// 是否开启同车体订单门闩。
    /// </summary>
    public bool EnableOrderGate { get; set; } = true;

    /// <summary>
    /// 是否开启 orderUpdate 前置校验。
    /// </summary>
    public bool EnableOrderUpdatePrecheck { get; set; } = true;

    /// <summary>
    /// 订单门闩锁 TTL(秒)。
    /// </summary>
    public int OrderGateTtlSeconds { get; set; } = 8;

    /// <summary>
    /// 订单门闩续租间隔(秒)。
    /// </summary>
    public int OrderGateRenewIntervalSeconds { get; set; } = 2;

    /// <summary>
    /// 机器人状态新鲜度阈值(秒)。
    /// </summary>
    public int OrderStateFreshnessSeconds { get; set; } = 5;

    /// <summary>
    /// 连续 precheck 失败触发恢复阈值。
    /// </summary>
    public int OrderPrecheckFailureThreshold { get; set; } = 3;

    /// <summary>
    /// 订单会话缓存保留时长(秒)。
    /// </summary>
    public int OrderSessionTtlSeconds { get; set; } = 600;

    /// <summary>
    /// 路径严格 binding 锁最小 TTL(秒)。
    /// </summary>
    public int PathBindingLockTtlMinSeconds { get; set; } = 20;

    /// <summary>
    /// 路径严格 binding 锁最大 TTL(秒)。
    /// </summary>
    public int PathBindingLockTtlMaxSeconds { get; set; } = 180;

    /// <summary>
    /// 路径严格 binding 锁回退 TTL(秒)。
    /// </summary>
    public int PathBindingLockTtlFallbackSeconds { get; set; } = 30;

    /// <summary>
    /// 路径严格 binding 锁时长安全系数。
    /// </summary>
    public double PathBindingLockTtlSafetyFactor { get; set; } = 2.5;

    /// <summary>
    /// 路径严格 binding 锁额外缓冲时长(秒)。
    /// </summary>
    public int PathBindingLockTtlBufferSeconds { get; set; } = 8;

    /// <summary>
    /// 动态计算路径锁 TTL 时使用的最小速度(米/秒)。
    /// </summary>
    public double PathBindingLockMinSpeedMetersPerSecond { get; set; } = 0.35;
}