Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/03/13 20:19:00 (12 years ago)
Author:
sforsten
Message:

#1980:

  • included an adapted version of GA correctly
  • added action set subsumption
  • added deletion after GA and before covering
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LCSAdaptedGeneticAlgorithm.cs

    r9089 r9105  
    5252      get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; }
    5353    }
     54    public ValueLookupParameter<IOperator> AfterCrossoverParameter {
     55      get { return (ValueLookupParameter<IOperator>)Parameters["AfterCrossover"]; }
     56    }
    5457    public ValueLookupParameter<PercentValue> MutationProbabilityParameter {
    5558      get { return (ValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; }
     
    102105      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
    103106      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
     107      Parameters.Add(new ValueLookupParameter<IOperator>("AfterCrossover", "The operator executed after crossing the solutions."));
    104108      Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
    105109      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
     
    121125      UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
    122126      Placeholder crossover = new Placeholder();
    123       DataReducer dataReducer = new DataReducer();
     127      Placeholder afterCrossover = new Placeholder();
    124128      StochasticBranch stochasticBranch = new StochasticBranch();
    125129      Placeholder mutator = new Placeholder();
    126130      SubScopesRemover subScopesRemover = new SubScopesRemover();
    127131      SubScopesCounter subScopesCounter = new SubScopesCounter();
    128       SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
    129       BestSelector bestSelector = new BestSelector();
    130       RightReducer rightReducer = new RightReducer();
    131132      MergingReducer mergingReducer = new MergingReducer();
    132133      IntCounter intCounter = new IntCounter();
     
    151152      crossover.OperatorParameter.ActualName = "Crossover";
    152153
    153       dataReducer.Name = "Average Fitness of Parents";
    154       dataReducer.ParameterToReduce.ActualName = "Fitness";
    155       dataReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Avg);
    156       dataReducer.TargetParameter.ActualName = "Fitness";
    157       dataReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign);
     154      afterCrossover.Name = "AfterCrossover";
     155      afterCrossover.OperatorParameter.ActualName = "AfterCrossover";
    158156
    159157      stochasticBranch.ProbabilityParameter.ActualName = "MutationProbability";
     
    167165      subScopesCounter.Name = "Increment EvaluatedSolutions";
    168166      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    169 
    170       bestSelector.CopySelected = new BoolValue(false);
    171       bestSelector.MaximizationParameter.ActualName = "Maximization";
    172       bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "N";
    173       bestSelector.QualityParameter.ActualName = "Fitness";
    174167
    175168      intCounter.Increment = new IntValue(1);
     
    195188      subScopesProcessor1.Operators.Add(new EmptyOperator());
    196189      subScopesProcessor1.Operators.Add(childrenCreator);
    197       subScopesProcessor1.Successor = subScopesProcessor2;
     190      subScopesProcessor1.Successor = mergingReducer;
    198191      childrenCreator.Successor = uniformSubScopesProcessor1;
    199192      uniformSubScopesProcessor1.Operator = crossover;
    200193      uniformSubScopesProcessor1.Successor = subScopesCounter;
    201       crossover.Successor = dataReducer;
    202       dataReducer.Successor = stochasticBranch;
     194      crossover.Successor = afterCrossover;
     195      afterCrossover.Successor = stochasticBranch;
    203196      stochasticBranch.FirstBranch = mutator;
    204197      stochasticBranch.SecondBranch = null;
     
    207200      subScopesRemover.Successor = null;
    208201      subScopesCounter.Successor = null;
    209       subScopesProcessor2.Operators.Add(bestSelector);
    210       subScopesProcessor2.Operators.Add(new EmptyOperator());
    211       subScopesProcessor2.Successor = mergingReducer;
    212       bestSelector.Successor = rightReducer;
    213       rightReducer.Successor = null;
    214202      mergingReducer.Successor = intCounter;
    215203      intCounter.Successor = comparator;
Note: See TracChangeset for help on using the changeset viewer.