Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/21/14 14:20:03 (10 years ago)
Author:
abeham
Message:

#2172:

  • Added hierarchy of parameters to enable this as a hidden parameter in OSGA, SASEGASA, Island-OSGA
    • New default value for Island-OSGA and SASEGASA is true (it will be set to false if loaded from an older file)
  • Changed visibility of some properties to public
File:
1 edited

Legend:

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

    r10639 r10643  
    2020#endregion
    2121
    22 using System.Linq;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
     
    2928using HeuristicLab.Parameters;
    3029using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    31 using HeuristicLab.Selection;
    3230
    3331namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm {
     
    131129    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
    132130      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
     131    }
     132    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
     133      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    133134    }
    134135    #endregion
     
    176177      Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island."));
    177178      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
     179      Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    178180      #endregion
    179181
     
    267269      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    268270      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
    269       foreach (var offspringSelector in mainOperator.OperatorGraph.Operators.OfType<OffspringSelector>())
    270         offspringSelector.FillPopulationWithParents = true;
     271      mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    271272
    272273      islandAnalyzer2.Name = "Island Analyzer (placeholder)";
     
    430431        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    431432      }
     433      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     434        Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    432435      #endregion
    433436    }
Note: See TracChangeset for help on using the changeset viewer.