Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Cargo"/> class.
        /// </summary>
        /// <param name="trackingId">A unique tracking ID.</param>
        /// <param name="routeSpecification">The route specification.</param>
        public Cargo(TrackingId trackingId, RouteSpecification routeSpecification)
        {
            Validate.notNull(trackingId, "Tracking ID is required");
            Validate.notNull(routeSpecification, "Route specification is required");

            TrackingId         = trackingId;
            RouteSpecification = routeSpecification;
            Delivery           = Delivery.BeforeHandling();
        }
 public MeetsDeadlineSpecification(RouteSpecification parent)
 {
     _parent = parent;
 }
 public SameDestinationSpecification(RouteSpecification parent)
 {
     _parent = parent;
 }
 public SameOriginSpecification(RouteSpecification parent)
 {
     _parent = parent;
 }
Beispiel #5
0
 /// <summary>
 /// Specifies a new route for this cargo.
 /// </summary>
 /// <param name="routeSpecification">route specification.</param>
 public virtual void SpecifyNewRoute(RouteSpecification routeSpecification)
 {
     Validate.notNull(routeSpecification, "Route specification is required");
     RouteSpecification = routeSpecification;
 }
Beispiel #6
0
 /// <summary>
 /// True if the cargo is routed and not misdirected
 /// </summary>
 /// <param name="itinerary">itinerary</param>
 /// <param name="routeSpecification">route specification</param>
 /// <returns>True if the cargo is routed and not misdirected</returns>
 internal bool IsOnRoute(Itinerary itinerary, RouteSpecification routeSpecification)
 {
     return(routeSpecification.StatusOf(itinerary) == RoutingStatus.ROUTED && !IsMisdirected(itinerary));
 }