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/PDExchange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveTabuCriterion.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/PDExchange/PotvinPDExchangeMoveTabuMaker.cs

    r6773 r7791  
    7373      get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; }
    7474    }
     75    public ILookupParameter<IntValue> PickupViolationsParameter {
     76      get { return (ILookupParameter<IntValue>)Parameters["PickupViolations"]; }
     77    }
    7578
    7679    [StorableConstructor]
     
    9295        Parameters.Add(new LookupParameter<DoubleValue>("Overload", "The overload of the individual"));
    9396        Parameters.Add(new LookupParameter<DoubleValue>("Tardiness", "The tardiness of the individual"));
     97        Parameters.Add(new LookupParameter<IntValue>("PickupViolations", "The number of pickup violations."));
    9498    }
    9599
     
    128132        tardiness = TardinessParameter.ActualValue.Value;
    129133
    130       tabuList.Add(new PotvinPDRelocateMoveAttribute(baseQuality, move.OldTour, move.City, distance, overload, tardiness));
    131       tabuList.Add(new PotvinPDRelocateMoveAttribute(baseQuality, move.Tour, move.Replaced, distance, overload, tardiness));
     134      int pickupViolations = 0;
     135      if (PickupViolationsParameter.ActualValue != null)
     136        pickupViolations = PickupViolationsParameter.ActualValue.Value;
     137
     138      tabuList.Add(new PotvinPDRelocateMoveAttribute(baseQuality, move.OldTour, move.City, distance, overload, tardiness, pickupViolations));
     139      tabuList.Add(new PotvinPDRelocateMoveAttribute(baseQuality, move.Tour, move.Replaced, distance, overload, tardiness, pickupViolations));
    132140      return base.Apply();
    133141    }
Note: See TracChangeset for help on using the changeset viewer.