Changeset 2235 for trunk/sources/HeuristicLab.GP.StructureIdentification
- Timestamp:
- 08/05/09 11:17:08 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3
- Files:
-
- 2 added
- 26 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj
r2222 r2235 83 83 <ItemGroup> 84 84 <Compile Include="AlgorithmBase.cs" /> 85 <Compile Include="BaseClasses\FunctionTreeBase.cs" /> 85 86 <Compile Include="Evaluators\SimpleGPEvaluatorBase.cs" /> 86 87 <Compile Include="HL3TreeEvaluator.cs" /> -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ModelAnalyzerExporter.cs
r2222 r2235 24 24 25 25 namespace HeuristicLab.GP.StructureIdentification { 26 public class ModelAnalyzerExporter : IFunctionTreeSerializer , IFunctionTreeNameGenerator{26 public class ModelAnalyzerExporter : IFunctionTreeSerializer { 27 27 #region IFunctionTreeExporter Members 28 28 … … 73 73 #endregion 74 74 75 private st ring ExportFunction(IFunction function, IFunctionTree tree) {75 private static string ExportFunction(IFunction function, IFunctionTree tree) { 76 76 // this is smelly, if there is a cleaner way to have a 'dynamic' visitor 77 77 // please let me know! (gkronber 14.10.2008) … … 103 103 } 104 104 105 #region IFunctionTreeNameGenerator Members 106 107 string IFunctionTreeNameGenerator.Name { 108 get { return "HL2 Representation"; } 109 } 110 111 public string GetName(IFunctionTree tree) { 105 public static string GetName(IFunctionTree tree) { 112 106 string name = ""; 113 107 try { … … 118 112 return name; 119 113 } 120 121 #endregion122 123 124 114 } 125 115 -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/SymbolicExpressionExporter.cs
r2222 r2235 26 26 27 27 namespace HeuristicLab.GP.StructureIdentification { 28 public class SymbolicExpressionExporter : IFunctionTreeSerializer , IFunctionTreeNameGenerator{28 public class SymbolicExpressionExporter : IFunctionTreeSerializer { 29 29 private StringBuilder builder; 30 30 private string currentIndent; … … 66 66 } 67 67 68 private st ring ExportFunction(IFunction function, IFunctionTree tree) {68 private static string ExportFunction(IFunction function, IFunctionTree tree) { 69 69 // this is smelly, if there is a cleaner way to have a 'dynamic' visitor 70 70 // please let me know! (gkronber 14.10.2008) … … 99 99 #endregion 100 100 101 #region IFunctionTreeNameGenerator Members 102 103 string IFunctionTreeNameGenerator.Name { 104 get { return "Symbolic Expression"; } 105 } 106 107 public string GetName(IFunctionTree tree) { 101 public static string GetName(IFunctionTree tree) { 108 102 string name = ""; 109 103 try { 110 104 name = ExportFunction(tree.Function, tree); 111 } catch(UnknownFunctionException) { 105 } 106 catch (UnknownFunctionException) { 112 107 name = "N/A"; 113 108 } … … 115 110 } 116 111 117 #endregion 112 //public string GetName(IFunctionTree tree) { 113 // return SymbolicExpressionExporter.GetName(tree); 114 //} 118 115 } 119 116 -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Addition.cs
r2222 r2235 38 38 MaxSubTrees = 3; 39 39 } 40 41 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 42 return new FunctionTreeBase(this); 43 } 40 44 } 41 45 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/And.cs
r2222 r2235 35 35 MinSubTrees = 2; MaxSubTrees = 3; 36 36 } 37 38 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 39 return new FunctionTreeBase(this); 40 } 37 41 } 38 42 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Average.cs
r2222 r2235 33 33 MinSubTrees = 2; MaxSubTrees = 3; 34 34 } 35 36 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 37 return new FunctionTreeBase(this); 38 } 35 39 } 36 40 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/ConstantFunctionTree.cs
r2222 r2235 30 30 public double Value { get; set; } 31 31 32 public ConstantFunctionTree(Constant constant) : base(constant){ 32 public ConstantFunctionTree(Constant constant) 33 : base(constant) { 33 34 } 34 35 35 protected ConstantFunctionTree(ConstantFunctionTree original) : base(original){ 36 protected ConstantFunctionTree(ConstantFunctionTree original) 37 : base(original) { 36 38 Value = original.Value; 37 39 } … … 57 59 } 58 60 61 public override string ToString() { 62 return SymbolicExpressionExporter.GetName(this); 63 } 64 65 #region serialization 59 66 public override object Clone() { 60 67 return new ConstantFunctionTree(this); … … 73 80 Value = XmlConvert.ToDouble(node.Attributes["Value"].Value); 74 81 } 82 #endregion 75 83 76 84 private IVariable CreateValueVariable() { -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Cosinus.cs
r2222 r2235 30 30 : base() { 31 31 } 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 32 36 } 33 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Division.cs
r2222 r2235 37 37 38 38 public Division() : base() { } 39 40 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 41 return new FunctionTreeBase(this); 42 } 39 43 } 40 44 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Equal.cs
r2222 r2235 30 30 31 31 public Equal() : base() { } 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 32 36 } 33 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Exponential.cs
r2222 r2235 28 28 29 29 public Exponential() : base() { } 30 31 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 32 return new FunctionTreeBase(this); 33 } 30 34 } 31 35 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/GreaterThan.cs
r2222 r2235 31 31 public GreaterThan() : base() { } 32 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 33 36 } 34 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/IfThenElse.cs
r2222 r2235 34 34 MinSubTrees = 3; MaxSubTrees = 3; 35 35 } 36 37 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 38 return new FunctionTreeBase(this); 39 } 36 40 } 37 41 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/LessThan.cs
r2222 r2235 32 32 : base() { 33 33 } 34 35 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 36 return new FunctionTreeBase(this); 37 } 34 38 } 35 39 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Logarithm.cs
r2222 r2235 30 30 : base() { 31 31 } 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 32 36 } 33 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Multiplication.cs
r2222 r2235 37 37 MinSubTrees = 2; MaxSubTrees = 3; 38 38 } 39 40 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 41 return new FunctionTreeBase(this); 42 } 39 43 } 40 44 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Not.cs
r2222 r2235 31 31 : base() { 32 32 } 33 34 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 35 return new FunctionTreeBase(this); 36 } 33 37 } 34 38 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Or.cs
r2222 r2235 33 33 MinSubTrees = 2; MaxSubTrees = 3; 34 34 } 35 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 36 return new FunctionTreeBase(this); 37 } 35 38 } 36 39 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Power.cs
r2222 r2235 30 30 : base() { 31 31 } 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 32 36 } 33 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Signum.cs
r2222 r2235 30 30 : base() { 31 31 } 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 32 36 } 33 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Sinus.cs
r2222 r2235 30 30 : base() { 31 31 } 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 32 36 } 33 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Sqrt.cs
r2222 r2235 30 30 : base() { 31 31 } 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 32 36 } 33 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Subtraction.cs
r2222 r2235 35 35 : base() { 36 36 } 37 38 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 39 return new FunctionTreeBase(this); 40 } 37 41 } 38 42 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Tangens.cs
r2222 r2235 30 30 : base() { 31 31 } 32 33 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 34 return new FunctionTreeBase(this); 35 } 32 36 } 33 37 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/VariableFunctionTree.cs
r2222 r2235 67 67 } 68 68 69 public override string ToString() { 70 return SymbolicExpressionExporter.GetName(this); 71 } 72 73 #region serialization 69 74 public override object Clone() { 70 75 return new VariableFunctionTree(this); … … 91 96 VariableName = node.Attributes["Variable"].Value; 92 97 } 98 #endregion 93 99 94 100 private IVariable CreateSampleOffsetVariable() { -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Symbols/Xor.cs
r2222 r2235 32 32 : base() { 33 33 } 34 35 public override HeuristicLab.GP.Interfaces.IFunctionTree GetTreeNode() { 36 return new FunctionTreeBase(this); 37 } 34 38 } 35 39 }
Note: See TracChangeset
for help on using the changeset viewer.