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/OffspringSelectionGeneticAlgorithm.cs

    r9592 r10643  
    112112      get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    113113    }
     114    private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
     115      get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
     116    }
    114117    #endregion
    115118
     
    190193      get { return MaximumEvaluatedSolutionsParameter.Value; }
    191194      set { MaximumEvaluatedSolutionsParameter.Value = value; }
     195    }
     196    public bool FillPopulationWithParents {
     197      get { return FillPopulationWithParentsParameter.Value.Value; }
     198      set { FillPopulationWithParentsParameter.Value.Value = value; }
    192199    }
    193200    private RandomCreator RandomCreator {
     
    219226        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true });
    220227      }
     228      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     229        Parameters.Add(new FixedValueParameter<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.", new BoolValue(false)) { Hidden = true });
    221230      #endregion
    222231
     
    254263      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
    255264      Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue)));
     265      Parameters.Add(new FixedValueParameter<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.", new BoolValue(false)) { Hidden = true });
    256266
    257267      RandomCreator randomCreator = new RandomCreator();
     
    297307      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
    298308      mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
     309      mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    299310
    300311      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name))
Note: See TracChangeset for help on using the changeset viewer.