Changeset 9105 for branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LCSAdaptedGeneticAlgorithm.cs
- Timestamp:
- 01/03/13 20:19:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LCSAdaptedGeneticAlgorithm.cs
r9089 r9105 52 52 get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; } 53 53 } 54 public ValueLookupParameter<IOperator> AfterCrossoverParameter { 55 get { return (ValueLookupParameter<IOperator>)Parameters["AfterCrossover"]; } 56 } 54 57 public ValueLookupParameter<PercentValue> MutationProbabilityParameter { 55 58 get { return (ValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; } … … 102 105 Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction.")); 103 106 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.")); 104 108 Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 105 109 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); … … 121 125 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 122 126 Placeholder crossover = new Placeholder(); 123 DataReducer dataReducer = new DataReducer();127 Placeholder afterCrossover = new Placeholder(); 124 128 StochasticBranch stochasticBranch = new StochasticBranch(); 125 129 Placeholder mutator = new Placeholder(); 126 130 SubScopesRemover subScopesRemover = new SubScopesRemover(); 127 131 SubScopesCounter subScopesCounter = new SubScopesCounter(); 128 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();129 BestSelector bestSelector = new BestSelector();130 RightReducer rightReducer = new RightReducer();131 132 MergingReducer mergingReducer = new MergingReducer(); 132 133 IntCounter intCounter = new IntCounter(); … … 151 152 crossover.OperatorParameter.ActualName = "Crossover"; 152 153 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"; 158 156 159 157 stochasticBranch.ProbabilityParameter.ActualName = "MutationProbability"; … … 167 165 subScopesCounter.Name = "Increment EvaluatedSolutions"; 168 166 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";174 167 175 168 intCounter.Increment = new IntValue(1); … … 195 188 subScopesProcessor1.Operators.Add(new EmptyOperator()); 196 189 subScopesProcessor1.Operators.Add(childrenCreator); 197 subScopesProcessor1.Successor = subScopesProcessor2;190 subScopesProcessor1.Successor = mergingReducer; 198 191 childrenCreator.Successor = uniformSubScopesProcessor1; 199 192 uniformSubScopesProcessor1.Operator = crossover; 200 193 uniformSubScopesProcessor1.Successor = subScopesCounter; 201 crossover.Successor = dataReducer;202 dataReducer.Successor = stochasticBranch;194 crossover.Successor = afterCrossover; 195 afterCrossover.Successor = stochasticBranch; 203 196 stochasticBranch.FirstBranch = mutator; 204 197 stochasticBranch.SecondBranch = null; … … 207 200 subScopesRemover.Successor = null; 208 201 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;214 202 mergingReducer.Successor = intCounter; 215 203 intCounter.Successor = comparator;
Note: See TracChangeset
for help on using the changeset viewer.