Changeset 18063
- Timestamp:
- 10/05/21 17:16:22 (3 years ago)
- Location:
- branches/3136_Structural_GP
- Files:
-
- 9 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/StructuredSymbolicRegressionSingleObjectiveProblem.cs
r18062 r18063 13 13 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 14 14 15 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression .SingleObjective{15 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression { 16 16 [StorableType("7464E84B-65CC-440A-91F0-9FA920D730F9")] 17 [Item(Name = "StructuredSymbolicRegressionSingleObjectiveProblem", Description = "A problem with a structural definition and unfixed subfunctions.")] 17 [Item(Name = "Structured Symbolic Regression Single Objective Problem (single-objective)", Description = "A problem with a structural definition and unfixed subfunctions.")] 18 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 150)] 18 19 public class StructuredSymbolicRegressionSingleObjectiveProblem : SingleObjectiveBasicProblem<MultiEncoding>, IRegressionProblem, IProblemInstanceConsumer<RegressionProblemData> { 19 20 … … 22 23 private const string StructureDefinitionParameterName = "Structure Definition"; 23 24 private const string GrammarParameterName = "Grammar"; 25 private const string StructureTemplateParameterName = "Structure Template"; 24 26 25 27 #endregion … … 28 30 public IValueParameter<IRegressionProblemData> ProblemDataParameter => (IValueParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName]; 29 31 public IFixedValueParameter<StringValue> StructureDefinitionParameter => (IFixedValueParameter<StringValue>)Parameters[StructureDefinitionParameterName]; 32 public IFixedValueParameter<StructureTemplate> StructureTemplateParameter => (IFixedValueParameter<StructureTemplate>)Parameters[StructureTemplateParameterName]; 30 33 public IValueParameter<ISymbolicDataAnalysisGrammar> GrammarParameter => (IValueParameter<ISymbolicDataAnalysisGrammar>)Parameters[GrammarParameterName]; // könnte auch weg? 31 34 #endregion … … 43 46 get => StructureDefinitionParameter.Value.Value; 44 47 set => StructureDefinitionParameter.Value.Value = value; 48 } 49 50 public StructureTemplate StructureTemplate { 51 get => StructureTemplateParameter.Value; 45 52 } 46 53 … … 71 78 Parameters.Add(new ValueParameter<RegressionProblemData>(ProblemDataParameterName, problemData)); 72 79 Parameters.Add(new FixedValueParameter<StringValue>(StructureDefinitionParameterName, new StringValue("e^f(x)/F(y)"))); 80 Parameters.Add(new FixedValueParameter<StructureTemplate>(StructureTemplateParameterName, new StructureTemplate())); 73 81 Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(GrammarParameterName, grammar)); 74 82 var parser = new InfixExpressionParser(); … … 78 86 } 79 87 80 public StructuredSymbolicRegressionSingleObjectiveProblem(StructuredSymbolicRegressionSingleObjectiveProblem original, Cloner cloner) { 81 } 88 public StructuredSymbolicRegressionSingleObjectiveProblem(StructuredSymbolicRegressionSingleObjectiveProblem original, Cloner cloner) { } 82 89 83 90 [StorableConstructor] 84 protected StructuredSymbolicRegressionSingleObjectiveProblem(StorableConstructorFlag _) : base(_) { 85 } 91 protected StructuredSymbolicRegressionSingleObjectiveProblem(StorableConstructorFlag _) : base(_) { } 86 92 87 93 public override IDeepCloneable Clone(Cloner cloner) => … … 97 103 98 104 public override double Evaluate(Individual individual, IRandom random) { 99 foreach(var kvp in individual.Values) { 105 Console.WriteLine(StructureTemplate.Template); 106 foreach (var kvp in individual.Values) { 100 107 if(kvp.Value is SymbolicExpressionTree tree) { 101 108 foreach(var n in tree.IterateNodesPrefix()) { -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r18052 r18063 122 122 <DependentUpon>InteractiveSymbolicExpressionTreeChart.cs</DependentUpon> 123 123 </Compile> 124 <Compile Include="StructureTemplate\StructureTemplateView.cs"> 125 <SubType>UserControl</SubType> 126 </Compile> 127 <Compile Include="StructureTemplate\StructureTemplateView.Designer.cs"> 128 <DependentUpon>StructureTemplateView.cs</DependentUpon> 129 </Compile> 130 <Compile Include="StructureTemplate\SubFunctionListView.cs"> 131 <SubType>UserControl</SubType> 132 </Compile> 133 <Compile Include="StructureTemplate\SubFunctionListView.Designer.cs"> 134 <DependentUpon>SubFunctionListView.cs</DependentUpon> 135 </Compile> 124 136 <Compile Include="SymbolicDataAnalysisModelMathView.cs"> 125 137 <SubType>UserControl</SubType> … … 304 316 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 305 317 </Content> 318 </ItemGroup> 319 <ItemGroup> 320 <EmbeddedResource Include="StructureTemplate\StructureTemplateView.resx"> 321 <DependentUpon>StructureTemplateView.cs</DependentUpon> 322 </EmbeddedResource> 306 323 </ItemGroup> 307 324 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r18062 r18063 180 180 <Compile Include="IntervalUtil.cs" /> 181 181 <Compile Include="Selectors\DiversitySelector.cs" /> 182 <Compile Include="StructureTemplate\StructureTemplate.cs" /> 183 <Compile Include="StructureTemplate\SubFunction.cs" /> 182 184 <Compile Include="SymbolicDataAnalysisExpressionTreeAverageSimilarityCalculator.cs" /> 183 185 <Compile Include="SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs" />
Note: See TracChangeset
for help on using the changeset viewer.