Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/08/13 14:12:00 (11 years ago)
Author:
sforsten
Message:

#1980:

  • added ProportionalTournamentSelector for XCS
  • fixed bug: if an initial population is created in XCS, the initial population also creates general classifier, not only specific ones
  • merged r9204:9466 HeuristicLab.Core from trunk to branch
Location:
branches/LearningClassifierSystems
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems

  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LearningClassifierSystemMainLoop.cs

    r9242 r9467  
    2525using HeuristicLab.Encodings.ConditionActionEncoding;
    2626using HeuristicLab.Operators;
    27 using HeuristicLab.Optimization;
    2827using HeuristicLab.Optimization.Operators;
    2928using HeuristicLab.Parameters;
     
    4241
    4342    #region Parameter Properties
    44     public IConstrainedValueParameter<ISelector> SelectorParameter {
    45       get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
     43    public ValueLookupParameter<IOperator> SelectorParameter {
     44      get { return adaptedGeneticAlgorithmMainLoop.SelectorParameter; }
    4645    }
    4746    public ValueLookupParameter<PercentValue> CrossoverProbabilityParameter {
     
    108107    private void Initialize() {
    109108      #region Create parameters
    110       Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction.", new ItemSet<ISelector>() { new ProportionalSelector() }, new ProportionalSelector()));
    111109      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
    112110      XCSAfterCopyingParentOperator afterCopyingParents = new XCSAfterCopyingParentOperator();
     
    273271      subsumptionSelector.CopySelected = new BoolValue(false);
    274272
    275       SelectorParameter.Value.CopySelected = new BoolValue(true);
    276       SelectorParameter.Value.NumberOfSelectedSubScopesParameter.Value = new IntValue(4);
    277 
    278273      evaluator.Name = "Evaluator";
    279274
     
    320315      afterCrossover.ParentAverageActionSetSizeParameter.ActualName = "AverageActionSetSize";
    321316
    322       adaptedGeneticAlgorithmMainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
    323317      adaptedGeneticAlgorithmMainLoop.RandomParameter.ActualName = "Random";
    324318      adaptedGeneticAlgorithmMainLoop.MaximumGenerationsParameter.ActualName = "ZeroIntValue";
     
    428422    }
    429423
    430     private void ParameterizeStochasticOperator(IOperator op) {
    431       IStochasticOperator stochasticOp = op as IStochasticOperator;
    432       if (stochasticOp != null) {
    433         stochasticOp.RandomParameter.ActualName = "Random";
    434         stochasticOp.RandomParameter.Hidden = true;
    435       }
    436     }
    437 
    438424    internal void SetCurrentProblem(IConditionActionProblem problem) {
    439425      initialSolutionsCreator.SolutionCreatorParameter.ActualName = problem.SolutionCreatorParameter.Name;
     
    485471      adaptedGeneticAlgorithmMainLoop.SetChildName(problem.ChildName);
    486472    }
    487     //private void ParameterizeSelectors() {
    488     //  foreach (ISelector selector in SelectorParameter.ValidValues) {
    489     //    selector.CopySelected = new BoolValue(true);
    490     //    //set value by parameter!
    491     //    selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(5);
    492     //    selector.NumberOfSelectedSubScopesParameter.Hidden = true;
    493     //    ParameterizeStochasticOperator(selector);
    494     //  }
    495     //  if (Problem != null) {
    496     //    foreach (ISingleObjectiveSelector selector in SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>()) {
    497     //      selector.MaximizationParameter.Value = new BoolValue(true);
    498     //      selector.MaximizationParameter.Hidden = true;
    499     //      selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    500     //      selector.QualityParameter.Hidden = true;
    501     //    }
    502     //  }
    503     //}
    504473  }
    505474}
Note: See TracChangeset for help on using the changeset viewer.