- Timestamp:
- 09/16/09 13:13:52 (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
r2362 r2363 156 156 157 157 public static void PopulateAnalyzerModel(IScope bestModelScope, IAnalyzerModel model) { 158 model.SetMetaData("EvaluatedSolutions", bestModelScope.GetVariableValue< DoubleData>("EvaluatedSolutions", false).Data);158 model.SetMetaData("EvaluatedSolutions", bestModelScope.GetVariableValue<IntData>("EvaluatedSolutions", false).Data); 159 159 IGeneticProgrammingModel gpModel = bestModelScope.GetVariableValue<IGeneticProgrammingModel>("FunctionTree", false); 160 160 model.SetMetaData("TreeSize", gpModel.Size); -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs
r2362 r2363 34 34 35 35 namespace HeuristicLab.GP.StructureIdentification { 36 public class OffspringSelectionGPRegression : HeuristicLab.GP.Algorithms.OffspringSelectionGP, I Algorithm {36 public class OffspringSelectionGPRegression : HeuristicLab.GP.Algorithms.OffspringSelectionGP, IStochasticAlgorithm { 37 37 public override string Name { get { return "OffspringSelectionGP - StructureIdentification"; } } 38 38 -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs
r2362 r2363 33 33 34 34 namespace HeuristicLab.GP.StructureIdentification { 35 public class StandardGPRegression : HeuristicLab.GP.Algorithms.StandardGP, I Algorithm {35 public class StandardGPRegression : HeuristicLab.GP.Algorithms.StandardGP, IStochasticAlgorithm { 36 36 37 37 public override string Name { get { return "StandardGP - StructureIdentification"; } } … … 96 96 97 97 protected override IOperator CreateGenerationStepHook() { 98 return DefaultStructureIdentificationOperators.CreateGenerationStepHook(); 98 IOperator op = DefaultStructureIdentificationOperators.CreateGenerationStepHook(); 99 op.AddSubOperator(CreateBestSolutionProcessor()); 100 return op; 99 101 } 102 103 private IOperator CreateBestSolutionProcessor() { 104 CombinedOperator op = new CombinedOperator(); 105 op.Name = "BestSolutionProcessor"; 106 SequentialProcessor seq = new SequentialProcessor(); 107 108 ProgrammableOperator evaluatedSolutionsStorer = new ProgrammableOperator(); 109 evaluatedSolutionsStorer.RemoveVariableInfo("Result"); 110 evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Input", "Value to copy", typeof(IntData), VariableKind.In)); 111 evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Output", "Value to write", typeof(IntData), VariableKind.New)); 112 evaluatedSolutionsStorer.GetVariableInfo("Input").ActualName = "EvaluatedSolutions"; 113 evaluatedSolutionsStorer.GetVariableInfo("Output").ActualName = "EvaluatedSolutions"; 114 evaluatedSolutionsStorer.Code = "Output.Data = Input.Data;"; 115 116 seq.AddSubOperator(evaluatedSolutionsStorer); 117 118 op.OperatorGraph.AddOperator(seq); 119 op.OperatorGraph.InitialOperator = seq; 120 return op; 121 } 122 100 123 101 124 protected override VariableInjector CreateGlobalInjector() { … … 150 173 } 151 174 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 173 175 protected virtual IOperator CreateModelAnalyzerOperator() { 174 176 return DefaultRegressionOperators.CreatePostProcessingOperator();
Note: See TracChangeset
for help on using the changeset viewer.