Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/10 17:19:34 (15 years ago)
Author:
abeham
Message:

#893

  • Fixed wiring of iteration based operators like the michalewicz manipulators for real vector encoding
Location:
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs

    r3689 r3750  
    197197      ParameterizeSolutionsCreator();
    198198      ParameterizeMainLoop();
    199       ParameterizeMoveEvaluators();
    200       ParameterizeMoveMakers();
    201       ParameterizeAnalyzers();
    202199      UpdateMoveGenerator();
    203200      UpdateMoveParameters();
    204201      UpdateAnalyzers();
     202      ParameterizeMoveEvaluators();
     203      ParameterizeMoveMakers();
     204      ParameterizeAnalyzers();
     205      ParameterizeIterationBasedOperators();
    205206      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    206207      base.OnProblemChanged();
     
    236237      ParameterizeMoveMakers();
    237238      ParameterizeAnalyzers();
     239      ParameterizeIterationBasedOperators();
    238240      base.Problem_OperatorsChanged(sender, e);
    239241    }
     
    366368      }
    367369    }
     370    private void ParameterizeIterationBasedOperators() {
     371      if (Problem != null) {
     372        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
     373          op.IterationsParameter.ActualName = "Iterations";
     374          op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
     375        }
     376      }
     377    }
    368378    #endregion
    369379  }
  • trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs

    r3715 r3750  
    137137      ConditionalBranch iterationsTermination = new ConditionalBranch();
    138138
    139       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
     139      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); // Class LocalSearch expects this to be called Iterations
    140140      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0)));
    141141      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0)));
Note: See TracChangeset for help on using the changeset viewer.