Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/WaitingStrategies/WaitingStrategy.cs @ 11247

Last change on this file since 11247 was 8670, checked in by svonolfe, 12 years ago

Added first version of the dynamic vehicle routing addon (#1955)

File size: 1.4 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Core;
6using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
7using HeuristicLab.Common;
8using HeuristicLab.PDPSimulation.Operators;
9using HeuristicLab.Problems.VehicleRouting;
10using HeuristicLab.Problems.VehicleRouting.Interfaces;
11
12namespace HeuristicLab.PDPSimulation {
13  [Item("Waiting strategy", "A pickup and delivery waiting strategy.")]
14  [StorableClass]
15  public abstract class WaitingStrategy : ParameterizedNamedItem {
16    [Storable]
17    protected PickupDeliveryScenario scenario;
18   
19    public WaitingStrategy()
20      : base() {
21    }
22    [StorableConstructor]
23    protected WaitingStrategy(bool deserializing) : base(deserializing) { }
24    protected WaitingStrategy(WaitingStrategy original, Cloner cloner)
25      : base(original, cloner) {
26        this.scenario = cloner.Clone<PickupDeliveryScenario>(original.scenario);
27    }
28
29    public virtual void SetScenario(PickupDeliveryScenario scenario) {
30      if (scenario != null) {
31        this.scenario = scenario;
32      }
33    }
34
35    public abstract double GetWaitingTime(double time, DynPDPProblemInstance instance, IVRPEncoding solution, Tour tour, int stop);
36
37    public virtual double GetBufferTime(double time, DynPDPProblemInstance instance, IVRPEncoding solution, Tour tour, int stop) {
38      return 0;
39    }
40  }
41}
Note: See TracBrowser for help on using the repository browser.