Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/22/12 09:38:54 (13 years ago)
Author:
svonolfe
Message:

Moved adaptive penalties to parameter values (#1177)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs

    r6856 r7864  
    5050    }
    5151
    52     [Storable]
    53     private DoubleValue currentPickupViolationPenalty;
     52    protected IValueParameter<DoubleValue> CurrentPickupViolationPenaltyParameter {
     53      get { return (IValueParameter<DoubleValue>)Parameters["CurrentPickupViolationPenalty"]; }
     54    }
    5455
    5556    public DoubleValue PickupViolationPenalty {
    5657      get {
     58        DoubleValue currentPickupViolationPenalty = CurrentPickupViolationPenaltyParameter.Value;
    5759        if (currentPickupViolationPenalty != null)
    5860          return currentPickupViolationPenalty;
     
    6062          return PickupViolationPenaltyParameter.Value;
    6163      }
    62       set { currentPickupViolationPenalty = value; }
     64      set { CurrentPickupViolationPenaltyParameter.Value = value; }
    6365    }
    6466
     
    9395
    9496      Parameters.Add(new ValueParameter<DoubleValue>("EvalPickupViolationPenalty", "The pickup violation penalty considered in the evaluation.", new DoubleValue(100)));
     97      Parameters.Add(new OptionalValueParameter<DoubleValue>("CurrentPickupViolationPenalty", "The current pickup violation penalty considered in the evaluation."));
    9598
    9699      AttachEventHandlers();
     
    103106    protected MDCVRPPDTWProblemInstance(MDCVRPPDTWProblemInstance original, Cloner cloner)
    104107      : base(original, cloner) {
    105         currentPickupViolationPenalty = cloner.Clone(original.currentPickupViolationPenalty) as DoubleValue;
    106 
    107108        AttachEventHandlers();
    108109    }
     
    120121      base.InitializeState();
    121122
    122       currentPickupViolationPenalty = null;
     123      CurrentPickupViolationPenaltyParameter.Value = null;
    123124    }
    124125
Note: See TracChangeset for help on using the changeset viewer.