Changeset 9167 for branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems
- Timestamp:
- 01/15/13 15:52:54 (12 years ago)
- Location:
- branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LCSAdaptedGeneticAlgorithm.cs
r9160 r9167 54 54 get { return (ValueLookupParameter<IOperator>)Parameters["Selector"]; } 55 55 } 56 public ValueLookupParameter<IOperator> AfterCopyingParentsParameter { 57 get { return (ValueLookupParameter<IOperator>)Parameters["AfterCopyingParents"]; } 58 } 56 59 public ValueLookupParameter<IOperator> CrossoverParameter { 57 60 get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; } … … 112 115 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution.")); 113 116 Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction.")); 117 Parameters.Add(new ValueLookupParameter<IOperator>("AfterCopyingParents", "The operator executed after copying a parent instead of using crossover.")); 114 118 Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions.")); 115 119 Parameters.Add(new ValueLookupParameter<IOperator>("AfterCrossover", "The operator executed after crossing the solutions.")); … … 135 139 RandomSelector randomSelector = new RandomSelector(); 136 140 PreservingRightReducer preservingRightReducer = new PreservingRightReducer(); 137 Assigner numerosityAssigner = new Assigner(); 138 Assigner experienceAssigner = new Assigner(); 141 Placeholder afterCopyingParents = new Placeholder(); 139 142 Placeholder crossover = new Placeholder(); 140 143 Placeholder afterCrossover = new Placeholder(); … … 182 185 randomSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(1); 183 186 187 afterCopyingParents.Name = "AfterCopyingParents"; 188 afterCopyingParents.OperatorParameter.ActualName = "AfterCopyingParents"; 189 184 190 crossover.Name = "Crossover"; 185 191 crossover.OperatorParameter.ActualName = "Crossover"; 186 187 numerosityAssigner.LeftSideParameter.ActualName = "Numerosity";188 numerosityAssigner.RightSideParameter.Value = new IntValue(1);189 190 experienceAssigner.LeftSideParameter.ActualName = "Experience";191 experienceAssigner.RightSideParameter.Value = new IntValue(0);192 192 193 193 afterCrossover.Name = "AfterCrossover"; … … 254 254 crossoverStochasticBranch.SecondBranch = randomSelector; 255 255 randomSelector.Successor = preservingRightReducer; 256 preservingRightReducer.Successor = numerosityAssigner; 257 numerosityAssigner.Successor = experienceAssigner; 258 experienceAssigner.Successor = null; 256 preservingRightReducer.Successor = afterCopyingParents; 259 257 crossoverStochasticBranch.Successor = mutator; 260 258 crossover.Successor = afterCrossover; -
branches/LearningClassifierSystems/HeuristicLab.Algorithms.LearningClassifierSystems/3.3/LearningClassifierSystemMainLoop.cs
r9154 r9167 52 52 get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; } 53 53 } 54 public IConstrainedValueParameter<IOperator> AfterCopyingParentsParameter { 55 get { return (IConstrainedValueParameter<IOperator>)Parameters["AfterCopyingParents"]; } 56 } 54 57 public IConstrainedValueParameter<IOperator> AfterCrossoverParameter { 55 58 get { return (IConstrainedValueParameter<IOperator>)Parameters["AfterCrossover"]; } … … 101 104 test.ChildParameter.ActualName = "CombinedIntegerVector"; 102 105 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.", new ItemSet<IManipulator>() { new UniformSomePositionManipulator() }, test)); 106 XCSAfterCopyingParentOperator afterCopyingParents = new XCSAfterCopyingParentOperator(); 107 Parameters.Add(new ConstrainedValueParameter<IOperator>("AfterCopyingParents", "", new ItemSet<IOperator>() { new XCSAfterCopyingParentOperator() }, afterCopyingParents)); 103 108 XCSAfterCrossoverOperator afterCrossover = new XCSAfterCrossoverOperator(); 104 Parameters.Add(new ConstrainedValueParameter<IOperator>("AfterCrossover", " The operator used to select solutions for reproduction.", new ItemSet<IOperator>() { new XCSAfterCrossoverOperator() }, afterCrossover));109 Parameters.Add(new ConstrainedValueParameter<IOperator>("AfterCrossover", "", new ItemSet<IOperator>() { new XCSAfterCrossoverOperator() }, afterCrossover)); 105 110 Parameters.Add(new LookupParameter<IntValue>("MaxIterations", "The maximum number of iterations the algorithm will do.")); 106 111 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation.")); 107 112 #endregion 108 109 110 //test111 DataReducer testReducer = new DataReducer();112 testReducer.TargetParameter.ActualName = "TestCurrentPopulation";113 testReducer.ParameterToReduce.ActualName = "Numerosity";114 testReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);115 testReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign);116 113 117 114 #region Create operators … … 315 312 adaptedGeneticAlgorithmMainLoop.MaximizationParameter.Value = new BoolValue(true); 316 313 adaptedGeneticAlgorithmMainLoop.AfterCrossoverParameter.ActualName = AfterCrossoverParameter.Name; 314 adaptedGeneticAlgorithmMainLoop.AfterCopyingParentsParameter.ActualName = AfterCopyingParentsParameter.Name; 317 315 318 316 currentPopulationSizeCounter.ValueParameter.ActualName = "CurrentPopulationSize"; … … 351 349 initialPopulationConditionalBranch.Successor = maxIterationsComparator; 352 350 maxIterationsComparator.Successor = terminationConditionalBranch1; 353 terminationConditionalBranch1.TrueBranch = finalAnalyzer;351 //terminationConditionalBranch1.TrueBranch = finalAnalyzer; 354 352 terminationConditionalBranch1.FalseBranch = classifierFetcher; 355 353 classifierFetcher.Successor = matchCondtionSubScopesProcessor; … … 410 408 //iterationCounter.Successor = maxIterationsComparator; 411 409 412 iterationCounter.Successor = testReducer;413 testReducer.Successor = maxIterationsComparator;410 iterationCounter.Successor = finalAnalyzer; 411 finalAnalyzer.Successor = maxIterationsComparator; 414 412 #endregion 415 413 }
Note: See TracChangeset
for help on using the changeset viewer.