Changeset 2362
- Timestamp:
- 09/15/09 18:16:05 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/DefaultStructureIdentificationOperators.cs
r2356 r2362 71 71 solutionStorer.GetVariableInfo("BestSolution").ActualName = "BestValidationSolution"; 72 72 solutionStorer.GetVariableInfo("Quality").ActualName = "ValidationQuality"; 73 74 OperatorExtractor bestSolutionProcessor = new OperatorExtractor(); 75 bestSolutionProcessor.Name = "BestSolutionProcessor (extr.)"; 76 bestSolutionProcessor.GetVariableInfo("Operator").ActualName = "BestSolutionProcessor"; 77 78 solutionStorer.AddSubOperator(bestSolutionProcessor); 73 79 74 80 BestAverageWorstQualityCalculator validationQualityCalculator = new BestAverageWorstQualityCalculator(); -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs
r2361 r2362 31 31 using HeuristicLab.Modeling; 32 32 using HeuristicLab.DataAnalysis; 33 using HeuristicLab.Operators.Programmable; 33 34 34 35 namespace HeuristicLab.GP.StructureIdentification { … … 94 95 95 96 protected override IOperator CreateGenerationStepHook() { 96 return DefaultStructureIdentificationOperators.CreateGenerationStepHook(); 97 IOperator hook = DefaultStructureIdentificationOperators.CreateGenerationStepHook(); 98 hook.AddSubOperator(CreateBestSolutionProcessor()); 99 return hook; 100 } 101 102 private IOperator CreateBestSolutionProcessor() { 103 CombinedOperator op = new CombinedOperator(); 104 op.Name = "BestSolutionProcessor"; 105 SequentialProcessor seq = new SequentialProcessor(); 106 107 ProgrammableOperator variableStorer = new ProgrammableOperator(); 108 variableStorer.RemoveVariableInfo("Result"); 109 variableStorer.AddVariableInfo(new VariableInfo("Input", "Value to copy", typeof(ObjectData), VariableKind.In)); 110 variableStorer.AddVariableInfo(new VariableInfo("Output", "Value to write", typeof(ObjectData), VariableKind.Out)); 111 variableStorer.Code = "scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(\"Output\"), (ObjectData)Input.Clone()));"; 112 113 IOperator evaluatedSolutionsStorer = (IOperator)variableStorer.Clone(); 114 evaluatedSolutionsStorer.GetVariableInfo("Input").ActualName = "EvaluatedSolutions"; 115 evaluatedSolutionsStorer.GetVariableInfo("Output").ActualName = "EvaluatedSolutions"; 116 117 IOperator selectionPressureStorer = (IOperator)variableStorer.Clone(); 118 selectionPressureStorer.GetVariableInfo("Input").ActualName = "SelectionPressure"; 119 selectionPressureStorer.GetVariableInfo("Output").ActualName = "SelectionPressure"; 120 121 seq.AddSubOperator(evaluatedSolutionsStorer); 122 seq.AddSubOperator(selectionPressureStorer); 123 124 op.OperatorGraph.AddOperator(seq); 125 op.OperatorGraph.InitialOperator = seq; 126 return op; 97 127 } 98 128 -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs
r2361 r2362 30 30 using System; 31 31 using HeuristicLab.DataAnalysis; 32 using HeuristicLab.Operators.Programmable; 32 33 33 34 namespace HeuristicLab.GP.StructureIdentification { … … 149 150 } 150 151 152 private IOperator CreateBestSolutionProcessor() { 153 CombinedOperator op = new CombinedOperator(); 154 op.Name = "BestSolutionProcessor"; 155 SequentialProcessor seq = new SequentialProcessor(); 156 157 ProgrammableOperator evaluatedSolutionsStorer = new ProgrammableOperator(); 158 evaluatedSolutionsStorer.RemoveVariableInfo("Result"); 159 evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Input", "Value to copy", typeof(IntData), VariableKind.In)); 160 evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Output", "Value to write", typeof(IntData), VariableKind.New)); 161 evaluatedSolutionsStorer.GetVariableInfo("Input").ActualName = "EvaluatedSolutions"; 162 evaluatedSolutionsStorer.GetVariableInfo("Output").ActualName = "EvaluatedSolutions"; 163 evaluatedSolutionsStorer.Code = "Output.Data = Input.Data;"; 164 165 seq.AddSubOperator(evaluatedSolutionsStorer); 166 167 op.OperatorGraph.AddOperator(seq); 168 op.OperatorGraph.InitialOperator = seq; 169 return op; 170 } 171 172 151 173 protected virtual IOperator CreateModelAnalyzerOperator() { 152 174 return DefaultRegressionOperators.CreatePostProcessingOperator();
Note: See TracChangeset
for help on using the changeset viewer.