Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/29/11 15:40:01 (14 years ago)
Author:
svonolfe
Message:

Merged changes from trunk into branch (#1177)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r5127 r5867  
    3232using HeuristicLab.PluginInfrastructure;
    3333using HeuristicLab.Common;
     34using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3435
    3536namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    3940    public IValueParameter<IVRPEvaluator> EvaluatorParameter {
    4041      get { return (ValueParameter<IVRPEvaluator>)Parameters["Evaluator"]; }
     42    }
     43
     44    IVRPEvaluator moveEvaluator;
     45
     46    public IVRPEvaluator MoveEvaluator {
     47      get {
     48        if (EvaluatorParameter.Value == null)
     49          return null;
     50        else {
     51          if (moveEvaluator == null) {
     52            moveEvaluator = EvaluatorParameter.Value.Clone() as IVRPEvaluator;
     53
     54            foreach (IParameter parameter in moveEvaluator.Parameters) {
     55              if (parameter is ILookupParameter
     56                && parameter != moveEvaluator.ProblemInstanceParameter
     57                && parameter != moveEvaluator.VRPToursParameter) {
     58                (parameter as ILookupParameter).ActualName =
     59                  VRPMoveEvaluator.MovePrefix +
     60                  (parameter as ILookupParameter).ActualName;
     61              }
     62            }
     63          }
     64
     65          return moveEvaluator;
     66        }
     67      }
    4168    }
    4269
     
    253280
    254281    private void AttachEventHandlers() {
     282      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
    255283      BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
    256284      DistanceFactorParameter.ValueChanged += new EventHandler(DistanceFactorParameter_ValueChanged);
     
    268296
    269297    #region Event handlers
     298    void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
     299      moveEvaluator = null;
     300    }
     301
    270302    void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) {
    271303      EvalBestKnownSolution();
Note: See TracChangeset for help on using the changeset viewer.