Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/06/12 09:52:52 (12 years ago)
Author:
ascheibe
Message:

#1861 merged changes from trunk into branch

Location:
branches/HeuristicLab.Mono
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Mono

  • branches/HeuristicLab.Mono/HeuristicLab.Problems.VehicleRouting

  • branches/HeuristicLab.Mono/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/PickupAndDelivery/PickupViolationsRelaxationVRPAnalyzer.cs

    r8053 r8585  
    6060      get { return (IValueParameter<DoubleValue>)Parameters["MinPenaltyFactor"]; }
    6161    }
     62    public IValueParameter<DoubleValue> MaxPenaltyFactorParameter {
     63      get { return (IValueParameter<DoubleValue>)Parameters["MaxPenaltyFactor"]; }
     64    }
    6265
    6366    public ValueLookupParameter<ResultCollection> ResultsParameter {
     
    8083      Parameters.Add(new ScopeTreeLookupParameter<IntValue>("PickupViolations", "The pickup violation of the VRP solutions which should be analyzed."));
    8184
    82       Parameters.Add(new ValueParameter<DoubleValue>("Sigma", "The sigma applied to the penalty factor.", new DoubleValue(0.04)));
    83       Parameters.Add(new ValueParameter<DoubleValue>("Phi", "The phi applied to the penalty factor.", new DoubleValue(0.01)));
     85      Parameters.Add(new ValueParameter<DoubleValue>("Sigma", "The sigma applied to the penalty factor.", new DoubleValue(0.5)));
     86      Parameters.Add(new ValueParameter<DoubleValue>("Phi", "The phi applied to the penalty factor.", new DoubleValue(0.5)));
    8487      Parameters.Add(new ValueParameter<DoubleValue>("MinPenaltyFactor", "The minimum penalty factor.", new DoubleValue(0.01)));
     88      Parameters.Add(new ValueParameter<DoubleValue>("MaxPenaltyFactor", "The maximum penalty factor.", new DoubleValue(100000)));
    8589
    8690      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored."));
     
    9599    }
    96100
     101    [StorableHook(HookType.AfterDeserialization)]
     102    private void AfterDeserialization() {
     103      // BackwardsCompatibility3.3
     104      #region Backwards compatible code, remove with 3.4
     105      if (!Parameters.ContainsKey("MaxPenaltyFactor")) {
     106        Parameters.Add(new ValueParameter<DoubleValue>("MaxPenaltyFactor", "The maximum penalty factor.", new DoubleValue(100000)));
     107      }
     108      #endregion
     109    }
     110
    97111    public override IOperation Apply() {
    98112      IPickupAndDeliveryProblemInstance pdp = ProblemInstanceParameter.ActualValue as IPickupAndDeliveryProblemInstance;
     
    105119      double phi = PhiParameter.Value.Value;
    106120      double minPenalty = MinPenaltyFactorParameter.Value.Value;
     121      double maxPenalty = MaxPenaltyFactorParameter.Value.Value;
    107122
    108123      for (int j = 0; j < qualities.Length; j++) {
     
    124139      if (pdp.PickupViolationPenalty.Value < minPenalty)
    125140        pdp.PickupViolationPenalty.Value = minPenalty;
     141      if (pdp.PickupViolationPenalty.Value > maxPenalty)
     142        pdp.PickupViolationPenalty.Value = maxPenalty;
    126143
    127144      for (int j = 0; j < qualities.Length; j++) {
Note: See TracChangeset for help on using the changeset viewer.