Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/22/15 16:56:47 (9 years ago)
Author:
pfleck
Message:

#2400

  • Interfaces for Capaciated-, PickupAndDelivery- and TimeWindowed-ProblemInstances now specify an additional penalty parameter to set the current penalty factor for the constraint relaxation.
  • The setter of the penalty-property in the ProblemInstances is removed.
  • A CurrentPenalty property is added for setting the adapted penalty value from the relaxation analyzers. These properties are explicitly implemented to "hide" the setter from the API, so that it wont be used unaware of the relaxation mechanics.
  • Hide the CurrentPenaltyParameters for same reasons to avoid setting it unwarily.
  • Added additional infos in the error message off the VRPInstances unit-test.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/TimeWindowed/TimeWindowRelaxationVRPAnalyzer.cs

    r12012 r12488  
    136136      double max = vrptw.TardinessPenalty.Value * (1 + phi);
    137137
    138       vrptw.TardinessPenalty = new DoubleValue(min + (max - min) * factor);
    139       if (vrptw.TardinessPenalty.Value < minPenalty)
    140         vrptw.TardinessPenalty.Value = minPenalty;
    141       if (vrptw.TardinessPenalty.Value > maxPenalty)
    142         vrptw.TardinessPenalty.Value = maxPenalty;
     138      vrptw.CurrentTardinessPenalty = new DoubleValue(min + (max - min) * factor);
     139      if (vrptw.CurrentTardinessPenalty.Value < minPenalty)
     140        vrptw.CurrentTardinessPenalty.Value = minPenalty;
     141      if (vrptw.CurrentTardinessPenalty.Value > maxPenalty)
     142        vrptw.CurrentTardinessPenalty.Value = maxPenalty;
    143143
    144144      for (int j = 0; j < qualities.Length; j++) {
    145         qualities[j].Value += tardiness[j].Value * vrptw.TardinessPenalty.Value;
     145        qualities[j].Value += tardiness[j].Value * vrptw.CurrentTardinessPenalty.Value;
    146146      }
    147147
    148148      if (!results.ContainsKey("Current Tardiness Penalty")) {
    149         results.Add(new Result("Current Tardiness Penalty", new DoubleValue(vrptw.TardinessPenalty.Value)));
     149        results.Add(new Result("Current Tardiness Penalty", new DoubleValue(vrptw.CurrentTardinessPenalty.Value)));
    150150      } else {
    151         (results["Current Tardiness Penalty"].Value as DoubleValue).Value = vrptw.TardinessPenalty.Value;
     151        (results["Current Tardiness Penalty"].Value as DoubleValue).Value = vrptw.CurrentTardinessPenalty.Value;
    152152      }
    153153
Note: See TracChangeset for help on using the changeset viewer.