Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/10 17:19:34 (14 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.OffspringSelectionGeneticAlgorithm/3.3
Files:
6 edited

Legend:

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

    r3744 r3750  
    373373      ParameterizeSelectors();
    374374      ParameterizeAnalyzers();
     375      ParameterizeIterationBasedOperators();
    375376      UpdateCrossovers();
    376377      UpdateMutators();
     
    396397    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    397398      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     399      ParameterizeIterationBasedOperators();
    398400      UpdateCrossovers();
    399401      UpdateMutators();
     
    542544      }
    543545    }
     546    private void ParameterizeIterationBasedOperators() {
     547      if (Problem != null) {
     548        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
     549          op.IterationsParameter.ActualName = "Generations";
     550          op.MaximumIterationsParameter.ActualName = MaximumGenerationsParameter.Name;
     551        }
     552      }
     553    }
    544554    private void UpdateCrossovers() {
    545555      ICrossover oldCrossover = CrossoverParameter.Value;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs

    r3744 r3750  
    210210
    211211      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Migrations", new IntValue(0)));
    212       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
     212      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class IslandOffspringSelectionGeneticAlgorithm expects this to be called Generations
    213213      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastMigration", new IntValue(0)));
    214214      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("TerminatedIslands", new IntValue(0)));
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r3744 r3750  
    284284      ParameterizeSelectors();
    285285      ParameterizeAnalyzers();
     286      ParameterizeIterationBasedOperators();
    286287      UpdateCrossovers();
    287288      UpdateMutators();
     
    307308    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    308309      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     310      ParameterizeIterationBasedOperators();
    309311      UpdateCrossovers();
    310312      UpdateMutators();
     
    394396      }
    395397    }
     398    private void ParameterizeIterationBasedOperators() {
     399      if (Problem != null) {
     400        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
     401          op.IterationsParameter.ActualName = "Generations";
     402          op.MaximumIterationsParameter.ActualName = MaximumGenerationsParameter.Name;
     403        }
     404      }
     405    }
    396406    private void UpdateCrossovers() {
    397407      ICrossover oldCrossover = CrossoverParameter.Value;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs

    r3744 r3750  
    139139      ConditionalBranch conditionalBranch2 = new ConditionalBranch();
    140140
    141       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
     141      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class OffspringSelectionGeneticAlgorithm expects this to be called Generations
    142142      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));
    143143      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0)));
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs

    r3744 r3750  
    332332      ParameterizeSelectors();
    333333      ParameterizeAnalyzers();
     334      ParameterizeIterationBasedOperators();
    334335      UpdateCrossovers();
    335336      UpdateMutators();
     
    355356    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    356357      foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op);
     358      ParameterizeIterationBasedOperators();
    357359      UpdateCrossovers();
    358360      UpdateMutators();
     
    480482      }
    481483    }
     484    private void ParameterizeIterationBasedOperators() {
     485      if (Problem != null) {
     486        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
     487          op.IterationsParameter.ActualName = "Generations";
     488          op.MaximumIterationsParameter.ActualName = MaximumGenerationsParameter.Name;
     489        }
     490      }
     491    }
    482492    private void UpdateCrossovers() {
    483493      ICrossover oldCrossover = CrossoverParameter.Value;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs

    r3744 r3750  
    191191
    192192      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Reunifications", new IntValue(0)));
    193       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
     193      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class SASEGASA expects this to be called Generations
    194194      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastReunification", new IntValue(0)));
    195195      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));
Note: See TracChangeset for help on using the changeset viewer.