- Timestamp:
- 05/25/11 10:50:21 (14 years ago)
- Location:
- branches/GP.Grammar.Editor
- Files:
-
- 3 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/MwDruGrammar.cs
r6179 r6284 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; … … 28 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 29 30 [StorableClass] 30 [Item(" TypeCoherentExpressionGrammar", "Represents a grammar for functional expressions in which special syntactic constraints are enforced so that boolean and real-valued expressions are not mixed.")]31 public class TypeCoherentExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {31 [Item("MwDruGrammar", "Represents a grammar for modeling with fixed structures for the voest B1 MwDru target variable.")] 32 public class MwDruGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar { 32 33 33 34 [StorableConstructor] 34 protected TypeCoherentExpressionGrammar(bool deserializing) : base(deserializing) { }35 protected TypeCoherentExpressionGrammar(TypeCoherentExpressionGrammar original, Cloner cloner) : base(original, cloner) { }36 public TypeCoherentExpressionGrammar()37 : base(ItemAttribute.GetName(typeof( TypeCoherentExpressionGrammar)), ItemAttribute.GetDescription(typeof(TypeCoherentExpressionGrammar))) {35 protected MwDruGrammar(bool deserializing) : base(deserializing) { } 36 protected MwDruGrammar(MwDruGrammar original, Cloner cloner) : base(original, cloner) { } 37 public MwDruGrammar() 38 : base(ItemAttribute.GetName(typeof(MwDruGrammar)), ItemAttribute.GetDescription(typeof(TypeCoherentExpressionGrammar))) { 38 39 Initialize(); 39 40 } 40 41 public override IDeepCloneable Clone(Cloner cloner) { 41 return new TypeCoherentExpressionGrammar(this, cloner);42 return new MwDruGrammar(this, cloner); 42 43 } 44 45 private HeuristicLab.Problems.DataAnalysis.Symbolic.Variable ggDru; 46 private HeuristicLab.Problems.DataAnalysis.Symbolic.Variable flamTmp; 43 47 44 48 private void Initialize() { … … 47 51 var mul = new Multiplication(); 48 52 var div = new Division(); 49 var mean = new Average();50 var sin = new Sine();51 var cos = new Cosine();52 var tan = new Tangent();53 53 var log = new Logarithm(); 54 var pow = new Power();55 pow.InitialFrequency = 0.0;56 var root = new Root();57 root.InitialFrequency = 0.0;58 54 var exp = new Exponential(); 59 var @if = new IfThenElse();60 var gt = new GreaterThan();61 var lt = new LessThan();62 var and = new And();63 var or = new Or();64 var not = new Not();65 66 var timeLag = new TimeLag();67 timeLag.InitialFrequency = 0.0;68 var integral = new Integral();69 integral.InitialFrequency = 0.0;70 var derivative = new Derivative();71 derivative.InitialFrequency = 0.0;72 var variableCondition = new VariableCondition();73 variableCondition.InitialFrequency = 0.0;74 55 75 56 var constant = new Constant(); … … 77 58 constant.MaxValue = 20; 78 59 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 79 var laggedVariable = new LaggedVariable();80 60 81 laggedVariable.InitialFrequency = 0.0; 82 mean.InitialFrequency = 0.0; 61 var fixedAdd1 = new Addition(); 62 fixedAdd1.Name = "fixed Addition 1"; 63 fixedAdd1.Fixed = true; 83 64 84 /* 85 * Start = RealValueExpression 86 * 87 * RealValueExpression = 88 * "Variable" | 89 * "Constant" | 90 * BinaryOperator RealValueExpression RealValueExpression | 91 * UnaryOperator RealValueExpression | 92 * "IF" BooleanExpression RealValueExpression RealValueExpression | 93 * "VariableCondition" RealValueExpression RealValueExpression 94 * 95 * BinaryOperator = 96 * "+" | "-" | "*" | "/" | "Power" 97 * 98 * UnaryOperator = 99 * "Sin" | "Cos" | "Tan" | "Log" | "Exp" 100 * 101 * BooleanExpression = 102 * "AND" BooleanExpression BooleanExpression | 103 * "OR" BooleanExpression BooleanExpression | 104 * "NOT" BooleanExpression | 105 * ">" RealValueExpression RealValueExpression | 106 * "<" RealValueExpression RealValueExpression 107 */ 65 var fixedAdd2 = new Addition(); 66 fixedAdd2.Name = "fixed Addition 2"; 67 fixedAdd2.Fixed = true; 108 68 109 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, pow, root, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable, variableCondition }; 69 var fixedMul = new Multiplication(); 70 fixedMul.Name = "fixed Multiplication"; 71 fixedMul.Fixed = true; 110 72 111 var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, timeLag, integral, derivative }; 112 var binaryFunctionSymbols = new List<Symbol>() { add, sub, mul, div, mean, pow, root, variableCondition }; 73 ggDru = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 74 ggDru.Name = "fixed Variable GGDru"; 75 ggDru.Fixed = true; 76 ggDru.VariableNames = new List<string>() { "GGDRU" }; 77 ggDru.WeightManipulatorMu = 1; 78 ggDru.WeightManipulatorSigma = 0; 79 ggDru.WeightMu = 1; 80 ggDru.WeightSigma = 0; 81 ggDru.MultiplicativeWeightManipulatorSigma = 0; 82 ggDru.Changed += new EventHandler(ggDru_Changed); 113 83 114 var unaryBooleanFunctionSymbols = new List<Symbol>() { not }; 115 var binaryBooleanFunctionSymbols = new List<Symbol>() { or, and }; 116 var relationalFunctionSymbols = new List<Symbol>() { gt, lt }; 117 var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable }; 118 var realValuedSymbols = unaryFunctionSymbols.Concat(binaryFunctionSymbols).Concat(terminalSymbols).Concat(new List<Symbol>() { @if }); 119 var booleanSymbols = unaryBooleanFunctionSymbols.Concat(binaryBooleanFunctionSymbols).Concat(relationalFunctionSymbols); 84 flamTmp = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 85 flamTmp.Name = "fixed Variable FlamTmp"; 86 flamTmp.Fixed = true; 87 flamTmp.VariableNames = new List<string>() { "FLAMTMP" }; 88 flamTmp.WeightManipulatorMu = 1; 89 flamTmp.WeightManipulatorSigma = 0; 90 flamTmp.WeightMu = 1; 91 flamTmp.WeightSigma = 0; 92 flamTmp.MultiplicativeWeightManipulatorSigma = 0; 93 flamTmp.Changed += new EventHandler(flamTmp_Changed); 94 95 var c273 = new Constant(); 96 c273.Name = "fixed Constant 273"; 97 c273.Fixed = true; 98 c273.MinValue = 273; 99 c273.MaxValue = 273; 100 c273.ManipulatorMu = 0; 101 c273.ManipulatorSigma = 0; 102 c273.MultiplicativeManipulatorSigma = 0; 103 104 var allSymbols = new List<Symbol>() 105 { add, sub, mul, div, log, exp, constant, variableSymbol, 106 fixedAdd1,fixedAdd2,fixedMul,ggDru,flamTmp,c273}; 107 108 var unaryFunctionSymbols = new List<Symbol>() { log, exp }; 109 var binaryFunctionSymbols = new List<Symbol>() { add, sub, mul, div }; 110 111 var terminalSymbols = new List<Symbol>() { variableSymbol, constant }; 112 var fixedTerminalSymbols = new List<Symbol>() { ggDru, flamTmp, c273 }; 113 var realValuedSymbols = unaryFunctionSymbols.Concat(binaryFunctionSymbols).Concat(terminalSymbols); 120 114 121 115 foreach (var symb in allSymbols) 122 116 AddSymbol(symb); 123 124 foreach (var unaryFun in unaryFunctionSymbols.Concat(unaryBooleanFunctionSymbols)) { 117 foreach (var terminalSymbol in terminalSymbols) { 118 SetSubtreeCount(terminalSymbol, 0, 0); 119 } 120 foreach (var terminalSymbol in fixedTerminalSymbols) { 121 SetSubtreeCount(terminalSymbol, 0, 0); 122 } 123 foreach (var unaryFun in unaryFunctionSymbols) { 125 124 SetSubtreeCount(unaryFun, 1, 1); 126 125 } 127 foreach (var binaryFun in binaryFunctionSymbols .Concat(binaryBooleanFunctionSymbols).Concat(relationalFunctionSymbols)) {126 foreach (var binaryFun in binaryFunctionSymbols) { 128 127 SetSubtreeCount(binaryFun, 2, 2); 129 128 } 130 129 131 foreach (var terminalSymbol in terminalSymbols) {132 SetSubtreeCount(terminalSymbol, 0, 0);133 }130 SetSubtreeCount(fixedAdd1, 3, 3); 131 SetSubtreeCount(fixedMul, 3, 3); 132 SetSubtreeCount(fixedAdd2, 2, 2); 134 133 135 SetSubtreeCount(@if, 3, 3);134 AddAllowedChildSymbol(StartSymbol, fixedAdd1); 136 135 136 AddAllowedChildSymbol(fixedAdd1, fixedMul, 0); 137 AddAllowedChildSymbol(fixedAdd1, ggDru, 1); 138 foreach (var symb in unaryFunctionSymbols.Concat(binaryFunctionSymbols).Concat(terminalSymbols)) 139 AddAllowedChildSymbol(fixedAdd1, symb, 2); 137 140 138 // allow only real-valued expressions as child of the start symbol 139 foreach (var symb in realValuedSymbols) { 140 AddAllowedChildSymbol(StartSymbol, symb); 141 AddAllowedChildSymbol(DefunSymbol, symb); 142 } 141 AddAllowedChildSymbol(fixedMul, constant, 0); 142 AddAllowedChildSymbol(fixedMul, fixedAdd2, 1); 143 foreach (var symb in realValuedSymbols) 144 AddAllowedChildSymbol(fixedMul, symb, 2); 145 146 AddAllowedChildSymbol(fixedAdd2, c273, 0); 147 AddAllowedChildSymbol(fixedAdd2, flamTmp, 1); 143 148 144 149 foreach (var symb in unaryFunctionSymbols) { … … 153 158 } 154 159 } 160 } 155 161 156 foreach (var childSymb in booleanSymbols) { 157 AddAllowedChildSymbol(@if, childSymb, 0); 158 } 159 foreach (var childSymb in realValuedSymbols) { 160 AddAllowedChildSymbol(@if, childSymb, 1); 161 AddAllowedChildSymbol(@if, childSymb, 2); 162 } 162 private void flamTmp_Changed(object sender, System.EventArgs e) { 163 if (flamTmp.VariableNames.Count() != 1 || flamTmp.VariableNames.ElementAt(0) != "FLAMTMP") 164 flamTmp.VariableNames = new List<string>() { "FLAMTMP" }; 165 } 163 166 164 foreach (var symb in relationalFunctionSymbols) { 165 foreach (var childSymb in realValuedSymbols) { 166 AddAllowedChildSymbol(symb, childSymb); 167 } 168 } 169 foreach (var symb in binaryBooleanFunctionSymbols) { 170 foreach (var childSymb in booleanSymbols) { 171 AddAllowedChildSymbol(symb, childSymb); 172 } 173 } 174 foreach (var symb in unaryBooleanFunctionSymbols) { 175 foreach (var childSymb in booleanSymbols) { 176 AddAllowedChildSymbol(symb, childSymb); 177 } 178 } 167 private void ggDru_Changed(object sender, System.EventArgs e) { 168 if (ggDru.VariableNames.Count() != 1 || ggDru.VariableNames.ElementAt(0) != "GGDRU") 169 ggDru.VariableNames = new List<string>() { "GGDRU" }; 179 170 } 180 171 } -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/Poly10Grammar.cs
r6179 r6284 28 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 29 29 [StorableClass] 30 [Item(" TypeCoherentExpressionGrammar", "Represents a grammar for functional expressions in which special syntactic constraints are enforced so that boolean and real-valued expressions are not mixed.")]31 public class TypeCoherentExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {30 [Item("Poly10Grammar", "Represents a grammar for modeling with fixed structures for the voest B1 MwDru target variable.")] 31 public class Poly10Grammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar { 32 32 33 33 [StorableConstructor] 34 protected TypeCoherentExpressionGrammar(bool deserializing) : base(deserializing) { }35 protected TypeCoherentExpressionGrammar(TypeCoherentExpressionGrammar original, Cloner cloner) : base(original, cloner) { }36 public TypeCoherentExpressionGrammar()37 : base(ItemAttribute.GetName(typeof( TypeCoherentExpressionGrammar)), ItemAttribute.GetDescription(typeof(TypeCoherentExpressionGrammar))) {34 protected Poly10Grammar(bool deserializing) : base(deserializing) { } 35 protected Poly10Grammar(Poly10Grammar original, Cloner cloner) : base(original, cloner) { } 36 public Poly10Grammar() 37 : base(ItemAttribute.GetName(typeof(Poly10Grammar)), ItemAttribute.GetDescription(typeof(TypeCoherentExpressionGrammar))) { 38 38 Initialize(); 39 39 } 40 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new TypeCoherentExpressionGrammar(this, cloner);41 return new Poly10Grammar(this, cloner); 42 42 } 43 43 … … 47 47 var mul = new Multiplication(); 48 48 var div = new Division(); 49 var mean = new Average();50 var sin = new Sine();51 var cos = new Cosine();52 var tan = new Tangent();53 var log = new Logarithm();54 var pow = new Power();55 pow.InitialFrequency = 0.0;56 var root = new Root();57 root.InitialFrequency = 0.0;58 var exp = new Exponential();59 var @if = new IfThenElse();60 var gt = new GreaterThan();61 var lt = new LessThan();62 var and = new And();63 var or = new Or();64 var not = new Not();65 66 var timeLag = new TimeLag();67 timeLag.InitialFrequency = 0.0;68 var integral = new Integral();69 integral.InitialFrequency = 0.0;70 var derivative = new Derivative();71 derivative.InitialFrequency = 0.0;72 var variableCondition = new VariableCondition();73 variableCondition.InitialFrequency = 0.0;74 49 75 50 var constant = new Constant(); 76 constant.MinValue = -20;77 constant.MaxValue = 20;78 51 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 79 var laggedVariable = new LaggedVariable();80 52 81 laggedVariable.InitialFrequency = 0.0; 82 mean.InitialFrequency = 0.0; 53 var fixedAdd1 = new Addition(); 54 fixedAdd1.Name = "fixed Addition1"; 55 fixedAdd1.Fixed = true; 83 56 84 /* 85 * Start = RealValueExpression 86 * 87 * RealValueExpression = 88 * "Variable" | 89 * "Constant" | 90 * BinaryOperator RealValueExpression RealValueExpression | 91 * UnaryOperator RealValueExpression | 92 * "IF" BooleanExpression RealValueExpression RealValueExpression | 93 * "VariableCondition" RealValueExpression RealValueExpression 94 * 95 * BinaryOperator = 96 * "+" | "-" | "*" | "/" | "Power" 97 * 98 * UnaryOperator = 99 * "Sin" | "Cos" | "Tan" | "Log" | "Exp" 100 * 101 * BooleanExpression = 102 * "AND" BooleanExpression BooleanExpression | 103 * "OR" BooleanExpression BooleanExpression | 104 * "NOT" BooleanExpression | 105 * ">" RealValueExpression RealValueExpression | 106 * "<" RealValueExpression RealValueExpression 107 */ 57 var fixedAdd2 = new Addition(); 58 fixedAdd2.Name = "fixed Addition2"; 59 fixedAdd2.Fixed = true; 108 60 109 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, pow, root, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable, variableCondition }; 61 var fixedAdd3 = new Addition(); 62 fixedAdd3.Name = "fixed Addition3"; 63 fixedAdd3.Fixed = true; 110 64 111 var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, timeLag, integral, derivative }; 112 var binaryFunctionSymbols = new List<Symbol>() { add, sub, mul, div, mean, pow, root, variableCondition }; 65 var fixedMul1 = new Multiplication(); 66 fixedMul1.Name = "fixed Multiplication1"; 67 fixedMul1.Fixed = true; 113 68 114 var unaryBooleanFunctionSymbols = new List<Symbol>() { not }; 115 var binaryBooleanFunctionSymbols = new List<Symbol>() { or, and }; 116 var relationalFunctionSymbols = new List<Symbol>() { gt, lt }; 117 var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable }; 118 var realValuedSymbols = unaryFunctionSymbols.Concat(binaryFunctionSymbols).Concat(terminalSymbols).Concat(new List<Symbol>() { @if }); 119 var booleanSymbols = unaryBooleanFunctionSymbols.Concat(binaryBooleanFunctionSymbols).Concat(relationalFunctionSymbols); 69 var fixedMul2 = new Multiplication(); 70 fixedMul2.Name = "fixed Multiplication2"; 71 fixedMul2.Fixed = true; 72 73 74 #region fixed variables 75 var x1 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 76 x1.Name = "fixed X1"; 77 x1.VariableNames = new List<string>() { "x1" }; 78 x1.Fixed = true; 79 80 81 var x2 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 82 x2.Name = "fixed X2"; 83 x2.VariableNames = new List<string>() { "x2" }; 84 x2.Fixed = true; 85 86 var x3 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 87 x3.Name = "fixed X3"; 88 x3.VariableNames = new List<string>() { "x3" }; 89 x3.Fixed = true; 90 91 var x4 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 92 x4.Name = "fixed X4"; 93 x4.VariableNames = new List<string>() { "x4" }; 94 x4.Fixed = true; 95 96 var x5 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 97 x5.Name = "fixed X5"; 98 x5.VariableNames = new List<string>() { "x5" }; 99 x5.Fixed = true; 100 101 var x6 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 102 x6.Name = "fixed X6"; 103 x6.VariableNames = new List<string>() { "x6" }; 104 x6.Fixed = true; 105 106 var x7 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 107 x7.Name = "fixed X7"; 108 x7.VariableNames = new List<string>() { "x7" }; 109 x7.Fixed = true; 110 111 var x8 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 112 x8.Name = "fixed X8"; 113 x8.VariableNames = new List<string>() { "x8" }; 114 x8.Fixed = true; 115 116 var x9 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 117 x9.Name = "fixed X9"; 118 x9.VariableNames = new List<string>() { "x9" }; 119 x9.Fixed = true; 120 121 var x10 = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 122 x10.Name = "fixed X10"; 123 x10.VariableNames = new List<string>() { "x10" }; 124 x10.Fixed = true; 125 #endregion 126 127 var fixedTerminalSymbols = new List<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>() { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 }; 128 var allSymbols = new List<Symbol>() 129 { add, sub, mul, div, constant, variableSymbol, 130 fixedAdd1,fixedMul1,fixedMul2}.Union(fixedTerminalSymbols); 131 132 var binaryFunctionSymbols = new List<Symbol>() { add, sub, mul, div }; 133 var terminalSymbols = new List<Symbol>() { variableSymbol, constant }; 134 var realValuedSymbols = binaryFunctionSymbols.Concat(terminalSymbols); 120 135 121 136 foreach (var symb in allSymbols) 122 137 AddSymbol(symb); 123 124 foreach (var unaryFun in unaryFunctionSymbols.Concat(unaryBooleanFunctionSymbols)) { 125 SetSubtreeCount(unaryFun, 1, 1); 138 foreach (var terminalSymbol in terminalSymbols.Union(fixedTerminalSymbols)) { 139 SetSubtreeCount(terminalSymbol, 0, 0); 126 140 } 127 foreach (var binaryFun in binaryFunctionSymbols .Concat(binaryBooleanFunctionSymbols).Concat(relationalFunctionSymbols)) {141 foreach (var binaryFun in binaryFunctionSymbols) { 128 142 SetSubtreeCount(binaryFun, 2, 2); 129 143 } 144 SetSubtreeCount(fixedAdd1, 3, 3); 145 SetSubtreeCount(fixedMul1, 3, 3); 146 SetSubtreeCount(fixedMul2, 3, 3); 130 147 131 foreach (var terminalSymbol in terminalSymbols) { 132 SetSubtreeCount(terminalSymbol, 0, 0); 148 AddAllowedChildSymbol(StartSymbol, fixedAdd1); 149 foreach (var symb in realValuedSymbols) { 150 AddAllowedChildSymbol(fixedAdd1, symb, 0); 133 151 } 134 152 135 SetSubtreeCount(@if, 3, 3); 153 AddAllowedChildSymbol(fixedAdd1, fixedMul1, 1); 154 AddAllowedChildSymbol(fixedAdd1, fixedMul2, 2); 136 155 137 156 138 // allow only real-valued expressions as child of the start symbol 139 foreach (var symb in realValuedSymbols) { 140 AddAllowedChildSymbol(StartSymbol, symb); 141 AddAllowedChildSymbol(DefunSymbol, symb); 142 } 157 AddAllowedChildSymbol(fixedMul1, x1, 0); 158 AddAllowedChildSymbol(fixedMul1, x7, 1); 159 AddAllowedChildSymbol(fixedMul1, x9, 2); 143 160 144 foreach (var symb in unaryFunctionSymbols) { 145 foreach (var childSymb in realValuedSymbols) { 146 AddAllowedChildSymbol(symb, childSymb); 147 } 148 } 161 AddAllowedChildSymbol(fixedMul2, x3, 0); 162 AddAllowedChildSymbol(fixedMul2, x6, 1); 163 AddAllowedChildSymbol(fixedMul2, x10, 2); 149 164 150 165 foreach (var symb in binaryFunctionSymbols) { … … 153 168 } 154 169 } 155 156 foreach (var childSymb in booleanSymbols) {157 AddAllowedChildSymbol(@if, childSymb, 0);158 }159 foreach (var childSymb in realValuedSymbols) {160 AddAllowedChildSymbol(@if, childSymb, 1);161 AddAllowedChildSymbol(@if, childSymb, 2);162 }163 164 foreach (var symb in relationalFunctionSymbols) {165 foreach (var childSymb in realValuedSymbols) {166 AddAllowedChildSymbol(symb, childSymb);167 }168 }169 foreach (var symb in binaryBooleanFunctionSymbols) {170 foreach (var childSymb in booleanSymbols) {171 AddAllowedChildSymbol(symb, childSymb);172 }173 }174 foreach (var symb in unaryBooleanFunctionSymbols) {175 foreach (var childSymb in booleanSymbols) {176 AddAllowedChildSymbol(symb, childSymb);177 }178 }179 170 } 180 171 } -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r6135 r6284 123 123 <Compile Include="Formatters\SymbolicDataAnalysisExpressionLatexFormatter.cs" /> 124 124 <Compile Include="Formatters\SymbolicDataAnalysisExpressionMATLABFormatter.cs" /> 125 <Compile Include="Grammars\Poly10Grammar.cs" /> 126 <Compile Include="Grammars\MwDruGrammar.cs" /> 125 127 <Compile Include="Interfaces\ISymbolicDataAnalysisBoundedOperator.cs" /> 126 128 <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionTreeInterpreter.cs" /> -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r6135 r6284 190 190 SymbolicExpressionTreeGrammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value; 191 191 foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Variable>()) { 192 varSymbol.VariableNames = ProblemData.AllowedInputVariables;192 if (!varSymbol.Fixed) varSymbol.VariableNames = ProblemData.AllowedInputVariables; 193 193 } 194 194 foreach (var varSymbol in SymbolicExpressionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableCondition>()) { 195 varSymbol.VariableNames = ProblemData.AllowedInputVariables;195 if (!varSymbol.Fixed) varSymbol.VariableNames = ProblemData.AllowedInputVariables; 196 196 } 197 197 } -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
r5809 r6284 126 126 } 127 127 128 protected override void OnChanged(EventArgs e) { 129 if (@Fixed) { 130 weightManipulatorMu = 1; 131 weightManipulatorSigma = 0; 132 weightMu = 1; 133 weightSigma = 0; 134 multiplicativeWeightManipulatorSigma = 0; 135 } 136 base.OnChanged(e); 137 } 138 128 139 public override ISymbolicExpressionTreeNode CreateTreeNode() { 129 140 return new VariableTreeNode(this);
Note: See TracChangeset
for help on using the changeset viewer.