LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
TransportAssignment.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
4
6
7/// <summary>An authorized lane-resource pair, with its delay in periods.</summary>
8[Serializable]
9[XmlType(TypeName = "transportAssignment")]
10public sealed class TransportAssignment : ModelObject
11{
12 private int _laneId;
13 private int _transportResourceId;
14 private int _leadTime;
16 public TransportAssignment(int laneId, int transportResourceId, int leadTime)
17 { LaneId = laneId; TransportResourceId = transportResourceId; LeadTime = leadTime; }
18 [XmlAttribute("laneId")]
19 public int LaneId { get => _laneId; set => SetProperty(ref _laneId, value); }
20 [XmlAttribute("transportResourceId")]
21 public int TransportResourceId { get => _transportResourceId; set => SetProperty(ref _transportResourceId, value); }
22 [XmlAttribute("leadTime")]
23 public int LeadTime
24 {
25 get => _leadTime;
26 set { ArgumentOutOfRangeException.ThrowIfNegative(value); SetProperty(ref _leadTime, value); }
27 }
28}
29
30/// <summary>A runtime join of the central lane and assignment; stores no copied business data.</summary>
31public sealed class AssignedTransportLane
32{
34 {
35 ArgumentNullException.ThrowIfNull(lane);
36 ArgumentNullException.ThrowIfNull(assignment);
37 if (lane.Id != assignment.LaneId) throw new ArgumentException("Lane and assignment do not match.");
38 Lane = lane; Assignment = assignment;
39 }
40 public TransportLane Lane { get; }
42 public int Id => Lane.Id;
43 public WarehouseReference Origin => Lane.Origin;
44 public WarehouseReference Destination => Lane.Destination;
45 public int LeadTime => Assignment.LeadTime;
46}
int Id
Gets or sets the numerical identifier of the entity.
Base class for model objects that notify listeners when one of their properties changes.
AssignedTransportLane(TransportLane lane, TransportAssignment assignment)
An authorized lane-resource pair, with its delay in periods.
TransportAssignment(int laneId, int transportResourceId, int leadTime)
Represents a transport lane between two warehouses.
Represents a serializable reference to a warehouse.