68 lines
2.8 KiB
C#
68 lines
2.8 KiB
C#
using System;
|
|
using MultiWheelC.TrajectoryPlanning.CoarsePath;
|
|
|
|
namespace MultiWheelC.TrajectoryPlanning.EMPlanner;
|
|
|
|
public sealed class EmTrajectoryMetadata
|
|
{
|
|
public EmTrajectoryMetadata(
|
|
string trajectoryId,
|
|
DateTimeOffset generatedAtUtc,
|
|
DateTimeOffset effectiveAtUtc,
|
|
long mapSnapshotId,
|
|
string referencePathId,
|
|
long vehicleStateSequenceId,
|
|
string previousTrajectoryId,
|
|
int segmentIndex,
|
|
TravelDirection direction,
|
|
EmTerminalType terminalType,
|
|
EmLongitudinalMode longitudinalMode,
|
|
EmPlanningScope planningScope)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(trajectoryId))
|
|
throw new ArgumentException("A trajectory ID is required.", nameof(trajectoryId));
|
|
if (mapSnapshotId < 0)
|
|
throw new ArgumentOutOfRangeException(nameof(mapSnapshotId));
|
|
if (string.IsNullOrWhiteSpace(referencePathId))
|
|
throw new ArgumentException("A reference path ID is required.", nameof(referencePathId));
|
|
if (vehicleStateSequenceId < 0)
|
|
throw new ArgumentOutOfRangeException(nameof(vehicleStateSequenceId));
|
|
if (segmentIndex < 0)
|
|
throw new ArgumentOutOfRangeException(nameof(segmentIndex));
|
|
if (!Enum.IsDefined(typeof(TravelDirection), direction))
|
|
throw new ArgumentOutOfRangeException(nameof(direction));
|
|
if (!Enum.IsDefined(typeof(EmTerminalType), terminalType))
|
|
throw new ArgumentOutOfRangeException(nameof(terminalType));
|
|
if (!Enum.IsDefined(typeof(EmLongitudinalMode), longitudinalMode))
|
|
throw new ArgumentOutOfRangeException(nameof(longitudinalMode));
|
|
if (!Enum.IsDefined(typeof(EmPlanningScope), planningScope))
|
|
throw new ArgumentOutOfRangeException(nameof(planningScope));
|
|
|
|
TrajectoryId = trajectoryId;
|
|
GeneratedAtUtc = generatedAtUtc;
|
|
EffectiveAtUtc = effectiveAtUtc;
|
|
MapSnapshotId = mapSnapshotId;
|
|
ReferencePathId = referencePathId;
|
|
VehicleStateSequenceId = vehicleStateSequenceId;
|
|
PreviousTrajectoryId = previousTrajectoryId ?? string.Empty;
|
|
SegmentIndex = segmentIndex;
|
|
Direction = direction;
|
|
TerminalType = terminalType;
|
|
LongitudinalMode = longitudinalMode;
|
|
PlanningScope = planningScope;
|
|
}
|
|
|
|
public string TrajectoryId { get; }
|
|
public DateTimeOffset GeneratedAtUtc { get; }
|
|
public DateTimeOffset EffectiveAtUtc { get; }
|
|
public long MapSnapshotId { get; }
|
|
public string ReferencePathId { get; }
|
|
public long VehicleStateSequenceId { get; }
|
|
public string PreviousTrajectoryId { get; }
|
|
public int SegmentIndex { get; }
|
|
public TravelDirection Direction { get; }
|
|
public EmTerminalType TerminalType { get; }
|
|
public EmLongitudinalMode LongitudinalMode { get; }
|
|
public EmPlanningScope PlanningScope { get; }
|
|
}
|