Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/29/11 15:51:56 (13 years ago)
Author:
svonolfe
Message:

Added support for multi depot CVRP instances (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/BiasedMultiVRPSolutionCrossover.cs

    r6716 r6851  
    160160      OperationCollection next = new OperationCollection(successorOp);
    161161      if (successor != null) {
    162         SelectedOperatorParameter.ActualValue = new StringValue(successor.GetType().Name);
     162        SelectedOperatorParameter.ActualValue = new StringValue(successor.Name);
    163163
    164164        if (CreateChildOperation)
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/BiasedMultiVRPSolutionManipulator.cs

    r6716 r6851  
    160160      OperationCollection next = new OperationCollection(successorOp);
    161161      if (successor != null) {
    162         SelectedOperatorParameter.ActualValue = new StringValue(successor.GetType().Name);
     162        SelectedOperatorParameter.ActualValue = new StringValue(successor.Name);
    163163
    164164        if (CreateChildOperation)
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/PermutationEncoding.cs

    r4899 r6851  
    3535    #region IVRPEncoding Members
    3636    public abstract List<Tour> GetTours();
     37
     38    public int GetTourIndex(Tour tour) {
     39      int index = -1;
     40
     41      List<Tour> tours = GetTours();
     42      for (int i = 0; i < tours.Count; i++) {
     43        if (tours[i].IsEqual(tour)) {
     44          index = i;
     45          break;
     46        }
     47      }
     48
     49      return index;
     50    }
     51
     52    public virtual int GetVehicleAssignment(int tour) {
     53      return tour;
     54    }
    3755    #endregion
    3856
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/TourEncoding.cs

    r6837 r6851  
    3838   
    3939    #region IVRPEncoding Members
    40     public void Repair() {
     40    public virtual void Repair() {
    4141      List<Tour> toBeRemoved = new List<Tour>();
    4242      foreach (Tour tour in Tours) {
     
    6262
    6363     return result;
     64    }
     65
     66    public int GetTourIndex(Tour tour) {
     67      int index = -1;
     68
     69      for (int i = 0; i < Tours.Count; i++) {
     70        if (Tours[i].IsEqual(tour)) {
     71          index = i;
     72          break;
     73        }
     74      }
     75
     76      return index;
     77    }
     78
     79    public virtual int GetVehicleAssignment(int tour) {
     80      return tour;
    6481    }
    6582
Note: See TracChangeset for help on using the changeset viewer.