Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/22/12 09:38:54 (12 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/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs

    r6711 r7864  
    7272    }
    7373
    74     [Storable]
    75     private DoubleValue currentTardinessPenalty;
     74    protected IValueParameter<DoubleValue> CurrentTardinessPenaltyParameter {
     75      get { return (IValueParameter<DoubleValue>)Parameters["CurrentTardinessPenalty"]; }
     76    }
    7677
    7778    public DoubleValue TardinessPenalty {
    7879      get {
     80        DoubleValue currentTardinessPenalty = CurrentTardinessPenaltyParameter.Value;
    7981        if (currentTardinessPenalty != null)
    8082          return currentTardinessPenalty;
     
    8284          return TardinessPenaltyParameter.Value;
    8385      }
    84       set { currentTardinessPenalty = value; }
     86      set { CurrentTardinessPenaltyParameter.Value = value; }
    8587    }
    8688
     
    112114      Parameters.Add(new ValueParameter<DoubleValue>("EvalTimeFactor", "The time factor considered in the evaluation.", new DoubleValue(0)));
    113115      Parameters.Add(new ValueParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation.", new DoubleValue(100)));
     116      Parameters.Add(new OptionalValueParameter<DoubleValue>("CurrentTardinessPenalty", "The current tardiness penalty considered in the evaluation."));
    114117
    115118      AttachEventHandlers();
     
    122125    protected CVRPTWProblemInstance(CVRPTWProblemInstance original, Cloner cloner)
    123126      : base(original, cloner) {
    124         currentTardinessPenalty = cloner.Clone(original.currentTardinessPenalty) as DoubleValue;
    125 
    126127        AttachEventHandlers();
    127128    }
     
    142143      base.InitializeState();
    143144
    144       currentTardinessPenalty = null;
     145      CurrentTardinessPenaltyParameter.Value = null;
    145146    }
    146147
Note: See TracChangeset for help on using the changeset viewer.