Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/12 15:31:22 (12 years ago)
Author:
svonolfe
Message:

Improved PDP moves (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveTabuCriterion.cs

    r6857 r7791  
    140140            quality += attribute.Tardiness * vrptw.TardinessPenalty.Value;
    141141
     142          IPickupAndDeliveryProblemInstance pdp = instance as IPickupAndDeliveryProblemInstance;
     143          if (pdp != null)
     144            quality += attribute.PickupViolations * pdp.PickupViolationPenalty.Value;
     145
    142146          if (!useAspiration || moveQuality >= quality) {
    143147            if (attribute.City == move.City && attribute.Tour == move.Tour) {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveTabuMaker.cs

    r6773 r7791  
    5555      get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; }
    5656    }
     57    public ILookupParameter<IntValue> PickupViolationsParameter {
     58      get { return (ILookupParameter<IntValue>)Parameters["PickupViolations"]; }
     59    }
    5760
    5861    [StorableConstructor]
     
    6871        Parameters.Add(new LookupParameter<DoubleValue>("Overload", "The overload of the individual"));
    6972        Parameters.Add(new LookupParameter<DoubleValue>("Tardiness", "The tardiness of the individual"));
     73        Parameters.Add(new LookupParameter<IntValue>("PickupViolations", "The number of pickup violations."));
    7074    }
    7175
     
    9195        tardiness = TardinessParameter.ActualValue.Value;
    9296
    93       return new PotvinPDRelocateMoveAttribute(baseQuality, move.Tour, move.City, distance, overload, tardiness);
     97      int pickupViolations = 0;
     98      if (PickupViolationsParameter.ActualValue != null)
     99        pickupViolations = PickupViolationsParameter.ActualValue.Value;
     100
     101      return new PotvinPDRelocateMoveAttribute(baseQuality, move.Tour, move.City, distance, overload, tardiness, pickupViolations);
    94102    }
    95103  }
Note: See TracChangeset for help on using the changeset viewer.