Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/19/12 13:17:29 (12 years ago)
Author:
ascheibe
Message:

#1722 fixed more licensing information and source formatting

Location:
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Common;
     23using HeuristicLab.Core;
     24using HeuristicLab.Data;
     25using HeuristicLab.Parameters;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    3328using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3629
    3730namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3831  [Item("MDCVRPEvaluator", "Represents a multi depot CVRP evaluator.")]
    3932  [StorableClass]
    40   public class MDCVRPEvaluator: VRPEvaluator {
     33  public class MDCVRPEvaluator : VRPEvaluator {
    4134    public ILookupParameter<DoubleValue> OverloadParameter {
    4235      get { return (ILookupParameter<DoubleValue>)Parameters["Overload"]; }
     
    10396    }
    10497
    105     protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 
     98    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
    10699      out bool feasible) {
    107100      CVRPInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPInsertionInfo;
    108      
     101
    109102      double costs = 0;
    110103      feasible = tourInsertionInfo.Penalty < double.Epsilon;
     
    120113        feasible = false;
    121114
    122         if(insertionInfo.SpareCapacity >= 0)
     115        if (insertionInfo.SpareCapacity >= 0)
    123116          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
    124117        else
    125118          costs += demand * overloadPenalty;
    126119      }
    127      
     120
    128121      return costs;
    129122    }
     
    140133      OverloadParameter.ActualValue.Value = (tourEvaluation as CVRPEvaluation).Overload;
    141134    }
    142    
     135
    143136    [StorableConstructor]
    144137    protected MDCVRPEvaluator(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPProblemInstance.cs

    r7934 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     24using HeuristicLab.Common;
     25using HeuristicLab.Core;
     26using HeuristicLab.Data;
     27using HeuristicLab.Parameters;
     28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2629using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    3330using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3631
    3732namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3833  [Item("MDCVRPPDTWEvaluator", "Represents a multi depot CVRPPDTW evaluator.")]
    3934  [StorableClass]
    40   public class MDCVRPPDTWEvaluator: MDCVRPTWEvaluator {
     35  public class MDCVRPPDTWEvaluator : MDCVRPTWEvaluator {
    4136    public ILookupParameter<IntValue> PickupViolationsParameter {
    4237      get { return (ILookupParameter<IntValue>)Parameters["PickupViolations"]; }
     
    149144
    150145        double spareCapacity = capacity - currentLoad;
    151         CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime, 
     146        CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime,
    152147          arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity);
    153148        tourInfo.AddStopInsertionInfo(stopInfo);
     
    187182    }
    188183
    189     protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 
     184    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
    190185      out bool feasible) {
    191186      CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo;
     
    327322      PickupViolationsParameter.ActualValue.Value = (tourEvaluation as CVRPPDTWEvaluation).PickupViolations;
    328323    }
    329    
     324
    330325    [StorableConstructor]
    331326    protected MDCVRPPDTWEvaluator(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs

    r7934 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     23using HeuristicLab.Common;
     24using HeuristicLab.Core;
     25using HeuristicLab.Data;
     26using HeuristicLab.Parameters;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2628using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    3329using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3630
    3731namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3832  [Item("MDCVRPTWEvaluator", "Represents a multi depot CVRPTW evaluator.")]
    3933  [StorableClass]
    40   public class MDCVRPTWEvaluator: MDCVRPEvaluator {
     34  public class MDCVRPTWEvaluator : MDCVRPEvaluator {
    4135    public ILookupParameter<DoubleValue> TardinessParameter {
    4236      get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; }
     
    130124        //service
    131125        double currentServiceTime = 0;
    132         if(end > 0)
     126        if (end > 0)
    133127          currentServiceTime = serviceTimes[end - 1];
    134128        serviceTime += currentServiceTime;
     
    193187        feasible = false;
    194188
    195         if(insertionInfo.SpareCapacity >= 0)
     189        if (insertionInfo.SpareCapacity >= 0)
    196190          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
    197191        else
     
    241235          //arrive later than before, probably don't have to wait
    242236          if (nextStop.WaitingTime > 0) {
    243             additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);           
     237            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
    244238          }
    245239
     
    248242            double spare = nextStop.SpareTime - additionalTime;
    249243            if (spare < 0)
    250               tardiness += -spare; 
     244              tardiness += -spare;
    251245          } else {
    252246            tardiness += additionalTime;
     
    279273      TravelTimeParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).TravelTime;
    280274    }
    281    
     275
    282276    [StorableConstructor]
    283277    protected MDCVRPTWEvaluator(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs

    r7934 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Common;
     23using HeuristicLab.Core;
     24using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2625using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    33 using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3626
    3727
     
    3929  [Item("SingleDepotVRPEvaluator", "Represents a single depot VRP evaluator.")]
    4030  [StorableClass]
    41   public class MultiDepotVRPEvaluator: VRPEvaluator {
     31  public class MultiDepotVRPEvaluator : VRPEvaluator {
    4232    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) {
    4333      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
    4434      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
    45      
     35
    4636      double distance = 0.0;
    4737      double quality = 0.0;
     
    7969      out bool feasible) {
    8070      StopInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index);
    81      
     71
    8272      double costs = 0;
    8373      feasible = true;
     
    8878      return costs;
    8979    }
    90    
     80
    9181    [StorableConstructor]
    9282    protected MultiDepotVRPEvaluator(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs

    r6854 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     24using HeuristicLab.Common;
    2825using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3026using HeuristicLab.Data;
    3127using HeuristicLab.Optimization;
     28using HeuristicLab.Parameters;
     29using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3230using HeuristicLab.PluginInfrastructure;
     31using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3332using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3533
    3634namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3735  [Item("MultiDepotVRPProblemInstance", "Represents a multi depot VRP instance.")]
    3836  [StorableClass]
    39   public class MultiDepotVRPProblemInstance: VRPProblemInstance, IMultiDepotProblemInstance {
     37  public class MultiDepotVRPProblemInstance : VRPProblemInstance, IMultiDepotProblemInstance {
    4038    protected IValueParameter<IntValue> DepotsParameter {
    4139      get { return (IValueParameter<IntValue>)Parameters["Depots"]; }
     
    6058      }
    6159    }
    62    
     60
    6361    protected override IEnumerable<IOperator> GetOperators() {
    6462      return ApplicationManager.Manager.GetInstances<IMultiDepotOperator>().Cast<IOperator>();
     
    9593    public override double[] GetCoordinates(int city) {
    9694      double[] coordinates;
    97      
     95
    9896      if (city == 0) {
    9997        //calculate centroid
     
    119117    public int GetDepot(int customer, IVRPEncoding solution) {
    120118      int depot = -1;
    121      
     119
    122120      Tour tour =
    123121          solution.GetTours().FirstOrDefault(t => t.Stops.Contains(customer));
     
    135133      if (start == 0 && end == 0)
    136134        return 0;
    137      
     135
    138136      if (start == 0) {
    139137        start = GetDepot(end, solution);
     
    146144        end += Depots.Value - 1;
    147145      }
    148      
     146
    149147      return base.GetDistance(start, end, solution);
    150148    }
    151149
    152     public override double GetInsertionDistance(int start, int customer, int end, IVRPEncoding solution, 
     150    public override double GetInsertionDistance(int start, int customer, int end, IVRPEncoding solution,
    153151      out double startDistance, out double endDistance) {
    154152      if (start == 0) {
     
    163161      }
    164162      customer += Depots.Value - 1;
    165      
     163
    166164      double distance = base.GetDistance(start, end, solution);
    167165
     
    173171      return newDistance - distance;
    174172    }
    175    
     173
    176174    [StorableConstructor]
    177175    protected MultiDepotVRPProblemInstance(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluation.cs

    r6752 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.Core;
    28 using HeuristicLab.Common;
    2922
    3023namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    4134    }
    4235  }
    43  
    44   public class CVRPEvaluation: VRPEvaluation {
     36
     37  public class CVRPEvaluation : VRPEvaluation {
    4538    public double Overload { get; set; }
    4639  }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Common;
     23using HeuristicLab.Core;
     24using HeuristicLab.Data;
     25using HeuristicLab.Parameters;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    3328using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3629
    3730namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3831  [Item("CVRPEvaluator", "Represents a single depot CVRP evaluator.")]
    3932  [StorableClass]
    40   public class CVRPEvaluator: VRPEvaluator {
     33  public class CVRPEvaluator : VRPEvaluator {
    4134    public ILookupParameter<DoubleValue> OverloadParameter {
    4235      get { return (ILookupParameter<DoubleValue>)Parameters["Overload"]; }
     
    5144      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
    5245      double originalQuality = eval.Quality;
    53      
     46
    5447      IHomogenousCapacitatedProblemInstance cvrpInstance = instance as IHomogenousCapacitatedProblemInstance;
    5548      DoubleArray demand = instance.Demand;
     
    10598    }
    10699
    107     protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 
     100    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
    108101      out bool feasible) {
    109102      CVRPInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPInsertionInfo;
    110      
     103
    111104      double costs = 0;
    112105      feasible = tourInsertionInfo.Penalty < double.Epsilon;
     
    125118        feasible = false;
    126119
    127         if(insertionInfo.SpareCapacity >= 0)
     120        if (insertionInfo.SpareCapacity >= 0)
    128121          costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty;
    129122        else
    130123          costs += demand * overloadPenalty;
    131124      }
    132      
     125
    133126      return costs;
    134127    }
     
    145138      OverloadParameter.ActualValue.Value = (tourEvaluation as CVRPEvaluation).Overload;
    146139    }
    147    
     140
    148141    [StorableConstructor]
    149142    protected CVRPEvaluator(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs

    r7934 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluation.cs

    r6855 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.Common;
    2823
    2924namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    3833
    3934    public double ArrivalSpareCapacity {
    40       get { return arrivalSpareCapacity;  }
     35      get { return arrivalSpareCapacity; }
    4136    }
    4237
    43     public CVRPPDTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, 
     38    public CVRPPDTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime,
    4439      double arrivalTime, double leaveTime, double spareTime, double waitingTime, List<int> visited, double arrivalSpareCapacity)
    4540      : base(start, end, spareCapacity, tourStartTime, arrivalTime, leaveTime, spareTime, waitingTime) {
    46         this.visited = visited;
    47         this.arrivalSpareCapacity = arrivalSpareCapacity;
     41      this.visited = visited;
     42      this.arrivalSpareCapacity = arrivalSpareCapacity;
    4843    }
    4944  }
    50  
    51   public class CVRPPDTWEvaluation: CVRPTWEvaluation {
     45
     46  public class CVRPPDTWEvaluation : CVRPTWEvaluation {
    5247    public int PickupViolations { get; set; }
    5348  }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     24using HeuristicLab.Common;
     25using HeuristicLab.Core;
     26using HeuristicLab.Data;
     27using HeuristicLab.Parameters;
     28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2629using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    3330using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3631
    3732namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3833  [Item("CVRPPDTWEvaluator", "Represents a single depot CVRPPDTW evaluator.")]
    3934  [StorableClass]
    40   public class CVRPPDTWEvaluator: CVRPTWEvaluator {
     35  public class CVRPPDTWEvaluator : CVRPTWEvaluator {
    4136    public ILookupParameter<IntValue> PickupViolationsParameter {
    4237      get { return (ILookupParameter<IntValue>)Parameters["PickupViolations"]; }
     
    119114        double arrivalSpareCapacity = capacity - currentLoad;
    120115
    121         bool validPickupDelivery = 
     116        bool validPickupDelivery =
    122117          validPickupDelivery =
    123118          ((demand[end] >= 0) ||
     
    134129
    135130        double spareCapacity = capacity - currentLoad;
    136         CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime, 
     131        CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime,
    137132          arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity);
    138133        tourInfo.AddStopInsertionInfo(stopInfo);
     
    172167    }
    173168
    174     protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 
     169    protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer,
    175170      out bool feasible) {
    176171      CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo;
     
    309304      PickupViolationsParameter.ActualValue.Value = (tourEvaluation as CVRPPDTWEvaluation).PickupViolations;
    310305    }
    311    
     306
    312307    [StorableConstructor]
    313308    protected CVRPPDTWEvaluator(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs

    r7934 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluation.cs

    r6855 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.Common;
    2822
    2923namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    3428      get { return tourStartTime; }
    3529    }
    36    
     30
    3731    private double arrivalTime;
    3832
     
    6155    public CVRPTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, double arrivalTime, double leaveTime, double spareTime, double waitingTime)
    6256      : base(start, end, spareCapacity) {
    63         this.tourStartTime = tourStartTime;
    64         this.arrivalTime = arrivalTime;
    65         this.leaveTime = leaveTime;
    66         this.spareTime = spareTime;
    67         this.waitingTime = waitingTime;
     57      this.tourStartTime = tourStartTime;
     58      this.arrivalTime = arrivalTime;
     59      this.leaveTime = leaveTime;
     60      this.spareTime = spareTime;
     61      this.waitingTime = waitingTime;
    6862    }
    6963  }
    70  
    71   public class CVRPTWEvaluation: CVRPEvaluation {
     64
     65  public class CVRPTWEvaluation : CVRPEvaluation {
    7266    public double Tardiness { get; set; }
    7367    public double TravelTime { get; set; }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     23using HeuristicLab.Common;
     24using HeuristicLab.Core;
     25using HeuristicLab.Data;
     26using HeuristicLab.Parameters;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2628using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    3329using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3630
    3731namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3832  [Item("CVRPTWEvaluator", "Represents a single depot CVRPTW evaluator.")]
    3933  [StorableClass]
    40   public class CVRPTWEvaluator: CVRPEvaluator {
     34  public class CVRPTWEvaluator : CVRPEvaluator {
    4135    public ILookupParameter<DoubleValue> TardinessParameter {
    4236      get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; }
     
    5549      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
    5650      double originalQuality = eval.Quality;
    57      
     51
    5852      IHomogenousCapacitatedProblemInstance cvrpInstance = instance as IHomogenousCapacitatedProblemInstance;
    5953      DoubleArray demand = instance.Demand;
     
    111105          currentWaitingTime = readyTime[end] - time;
    112106
    113         double waitTime = readyTime[end]-time;
     107        double waitTime = readyTime[end] - time;
    114108
    115109        waitingTime += currentWaitingTime;
     
    225219          //arrive later than before, probably don't have to wait
    226220          if (nextStop.WaitingTime > 0) {
    227             additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);           
     221            additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime);
    228222          }
    229223
     
    232226            double spare = nextStop.SpareTime - additionalTime;
    233227            if (spare < 0)
    234               tardiness += -spare; 
     228              tardiness += -spare;
    235229          } else {
    236230            tardiness += additionalTime;
     
    263257      TravelTimeParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).TravelTime;
    264258    }
    265    
     259
    266260    [StorableConstructor]
    267261    protected CVRPTWEvaluator(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs

    r7934 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Common;
     23using HeuristicLab.Core;
     24using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2625using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    33 using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3626
    3727
     
    3929  [Item("SingleDepotVRPEvaluator", "Represents a single depot VRP evaluator.")]
    4030  [StorableClass]
    41   public class SingleDepotVRPEvaluator: VRPEvaluator {
     31  public class SingleDepotVRPEvaluator : VRPEvaluator {
    4232    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) {
    4333      TourInsertionInfo tourInfo = new TourInsertionInfo(solution.GetVehicleAssignment(solution.GetTourIndex(tour)));
    4434      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
    45      
     35
    4636      double distance = 0.0;
    4737      double quality = 0.0;
     
    7969      out bool feasible) {
    8070      StopInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index);
    81      
     71
    8272      double costs = 0;
    8373      feasible = true;
     
    9282      return costs;
    9383    }
    94    
     84
    9585    [StorableConstructor]
    9686    protected SingleDepotVRPEvaluator(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs

    r4752 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     24using HeuristicLab.Common;
    2825using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    3026using HeuristicLab.Data;
    3127using HeuristicLab.Optimization;
     28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3229using HeuristicLab.PluginInfrastructure;
     30using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3331using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Common;
    3532
    3633namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3734  [Item("SingleDepotVRPProblemInstance", "Represents a single depot VRP instance.")]
    3835  [StorableClass]
    39   public class SingleDepotVRPProblemInstance: VRPProblemInstance, ISingleDepotProblemInstance {
     36  public class SingleDepotVRPProblemInstance : VRPProblemInstance, ISingleDepotProblemInstance {
    4037    protected override IEnumerable<IOperator> GetOperators() {
    4138      return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>().Cast<IOperator>();
     
    6562      }
    6663    }
    67    
     64
    6865    [StorableConstructor]
    6966    protected SingleDepotVRPProblemInstance(bool deserializing) : base(deserializing) { }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluation.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.Core;
    28 using HeuristicLab.Common;
    2923
    3024namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    31   public class StopInsertionInfo {   
     25  public class StopInsertionInfo {
    3226    private int start;
    3327
     
    4135      get { return end; }
    4236    }
    43        
     37
    4438    public StopInsertionInfo(int start, int end)
    4539      : base() {
    46         this.start = start;
    47         this.end = end;
     40      this.start = start;
     41      this.end = end;
    4842    }
    4943  }
     
    6761    }
    6862
    69    public StopInsertionInfo GetStopInsertionInfo(int stop) {
     63    public StopInsertionInfo GetStopInsertionInfo(int stop) {
    7064      return stopInsertionInfos[stop];
    71     } 
     65    }
    7266
    7367    public int GetStopCount() {
     
    7872  public class InsertionInfo {
    7973    private List<TourInsertionInfo> tourInsertionInfos;
    80    
     74
    8175    public InsertionInfo()
    8276      : base() {
    83         tourInsertionInfos = new List<TourInsertionInfo>();
     77      tourInsertionInfos = new List<TourInsertionInfo>();
    8478    }
    8579
    86     public void AddTourInsertionInfo(TourInsertionInfo info) {     
     80    public void AddTourInsertionInfo(TourInsertionInfo info) {
    8781      tourInsertionInfos.Add(info);
    8882    }
     
    9286    }
    9387  }
    94  
     88
    9589  public class VRPEvaluation {
    9690    public double Quality { get; set; }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs

    r7276 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Common;
     23using HeuristicLab.Core;
     24using HeuristicLab.Data;
     25using HeuristicLab.Parameters;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Problems.VehicleRouting.Encodings;
    2628using HeuristicLab.Problems.VehicleRouting.Interfaces;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Parameters;
    30 using HeuristicLab.Data;
    31 using HeuristicLab.Optimization;
    32 using HeuristicLab.PluginInfrastructure;
    33 using HeuristicLab.Problems.VehicleRouting.Variants;
    34 using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Common;
    3629
    3730namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3831  [Item("VRPEvaluator", "Represents a VRP evaluator.")]
    3932  [StorableClass]
    40   public abstract class VRPEvaluator: VRPOperator, IVRPEvaluator {
     33  public abstract class VRPEvaluator : VRPOperator, IVRPEvaluator {
    4134    public ILookupParameter<IVRPEncoding> VRPToursParameter {
    4235      get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
    4336    }
    44    
     37
    4538    #region ISingleObjectiveEvaluator Members
    4639    public ILookupParameter<DoubleValue> QualityParameter {
     
    5952      get { return (ILookupParameter<DoubleValue>)Parameters["Penalty"]; }
    6053    }
    61    
     54
    6255    [StorableConstructor]
    6356    protected VRPEvaluator(bool deserializing) : base(deserializing) { }
     
    110103        instance,
    111104        solution,
    112         eval.InsertionInfo.GetTourInsertionInfo(tour), 
     105        eval.InsertionInfo.GetTourInsertionInfo(tour),
    113106        index,
    114107        customer, out tourFeasible);
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r8006 r8053  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
Note: See TracChangeset for help on using the changeset viewer.