- Timestamp:
- 09/20/11 11:12:10 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:ignore
-
old new 13 13 *.vsp 14 14 *.docstates 15 bin 16 HeuristicLab 3.3.6.0.ReSharper.user
-
- Property svn:mergeinfo changed
/branches/GP.Grammar.Editor (added) merged: 6284-6285,6296,6299,6335,6337,6377,6379,6387,6403,6409,6415,6493-6494,6497,6618,6620,6622,6626,6647,6675,6782,6784,6786,6795
- Property svn:ignore
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic
-
Property
svn:ignore
set to
bin
-
Property
svn:ignore
set to
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs
r6728 r6803 85 85 StringBuilder builder = new StringBuilder(); 86 86 builder.Append("(" + tree.ToString()); 87 for (int i = 0; i < tree.Subtree sCount; i++) {87 for (int i = 0; i < tree.SubtreeCount; i++) { 88 88 builder.Append(" " + GetTextualRepresentationFromSubtreeOfDepth(tree.GetSubtree(i), d - 1)); 89 89 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
r5817 r6803 73 73 FormatBegin(node, strBuilder); 74 74 75 if (node.Subtree sCount > 0) {75 if (node.SubtreeCount > 0) { 76 76 strBuilder.Append(FormatRecursively(node.GetSubtree(0))); 77 77 } … … 91 91 strBuilder.Append(@" \left( "); 92 92 } else if (node.Symbol is Subtraction) { 93 if (node.Subtree sCount == 1) {93 if (node.SubtreeCount == 1) { 94 94 strBuilder.Append(@"- \left("); 95 95 } else { … … 98 98 } else if (node.Symbol is Multiplication) { 99 99 } else if (node.Symbol is Division) { 100 if (node.Subtree sCount == 1) {100 if (node.SubtreeCount == 1) { 101 101 strBuilder.Append(@" \cfrac{1}{"); 102 102 } else { … … 105 105 } else if (node.Symbol is Average) { 106 106 // skip output of (1/1) if only one subtree 107 if (node.Subtree sCount > 1) {108 strBuilder.Append(@" \cfrac{1}{" + node.Subtree sCount + @"}");107 if (node.SubtreeCount > 1) { 108 strBuilder.Append(@" \cfrac{1}{" + node.SubtreeCount + @"}"); 109 109 } 110 110 strBuilder.Append(@" \left("); … … 246 246 } else if (node.Symbol is Division) { 247 247 strBuilder.Append("} "); 248 if (node.Subtree sCount > 1)248 if (node.SubtreeCount > 1) 249 249 strBuilder.Append("{1} "); 250 for (int i = 1; i < node.Subtree sCount; i++) {250 for (int i = 1; i < node.SubtreeCount; i++) { 251 251 strBuilder.Append(" } "); 252 252 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs
r5809 r6803 106 106 107 107 if (symbol is Addition) { 108 for (int i = 0; i < node.Subtree sCount; i++) {108 for (int i = 0; i < node.SubtreeCount; i++) { 109 109 if (i > 0) stringBuilder.Append("+"); 110 110 stringBuilder.Append(FormatRecursively(node.GetSubtree(i))); … … 112 112 } else if (symbol is And) { 113 113 stringBuilder.Append("(("); 114 for (int i = 0; i < node.Subtree sCount; i++) {114 for (int i = 0; i < node.SubtreeCount; i++) { 115 115 if (i > 0) stringBuilder.Append("&"); 116 116 stringBuilder.Append("(("); … … 121 121 } else if (symbol is Average) { 122 122 stringBuilder.Append("(1/"); 123 stringBuilder.Append(node.Subtree sCount);123 stringBuilder.Append(node.SubtreeCount); 124 124 stringBuilder.Append(")*("); 125 for (int i = 0; i < node.Subtree sCount; i++) {125 for (int i = 0; i < node.SubtreeCount; i++) { 126 126 if (i > 0) stringBuilder.Append("+"); 127 127 stringBuilder.Append("("); … … 138 138 stringBuilder.Append(")"); 139 139 } else if (symbol is Division) { 140 if (node.Subtree sCount == 1) {140 if (node.SubtreeCount == 1) { 141 141 stringBuilder.Append("1/"); 142 142 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); … … 144 144 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 145 145 stringBuilder.Append("/("); 146 for (int i = 1; i < node.Subtree sCount; i++) {146 for (int i = 1; i < node.SubtreeCount; i++) { 147 147 if (i > 1) stringBuilder.Append("*"); 148 148 stringBuilder.Append(FormatRecursively(node.GetSubtree(i))); … … 187 187 stringBuilder.Append(")"); 188 188 } else if (symbol is Multiplication) { 189 for (int i = 0; i < node.Subtree sCount; i++) {189 for (int i = 0; i < node.SubtreeCount; i++) { 190 190 if (i > 0) stringBuilder.Append("*"); 191 191 stringBuilder.Append(FormatRecursively(node.GetSubtree(i))); … … 197 197 } else if (symbol is Or) { 198 198 stringBuilder.Append("(("); 199 for (int i = 0; i < node.Subtree sCount; i++) {199 for (int i = 0; i < node.SubtreeCount; i++) { 200 200 if (i > 0) stringBuilder.Append("|"); 201 201 stringBuilder.Append("(("); … … 209 209 stringBuilder.Append(")"); 210 210 } else if (symbol is Subtraction) { 211 if (node.Subtree sCount == 1) {211 if (node.SubtreeCount == 1) { 212 212 stringBuilder.Append("-1*"); 213 213 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 214 214 } else { 215 215 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 216 for (int i = 1; i < node.Subtree sCount; i++) {216 for (int i = 1; i < node.SubtreeCount; i++) { 217 217 stringBuilder.Append("-"); 218 218 stringBuilder.Append(FormatRecursively(node.GetSubtree(i))); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs
r5809 r6803 25 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.PluginInfrastructure; 27 28 28 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 30 [NonDiscoverableType] 29 31 [StorableClass] 30 32 [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")] -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
r5809 r6803 30 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 31 public class TypeCoherentExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar { 32 private const string ArithmeticFunctionsName = "Arithmetic Functions"; 33 private const string TrigonometricFunctionsName = "Trigonometric Functions"; 34 private const string ExponentialFunctionsName = "Exponential and Logarithmic Functions"; 35 private const string RealValuedSymbolsName = "Real Valued Symbols"; 36 private const string TerminalsName = "Terminals"; 37 private const string PowerFunctionsName = "Power Functions"; 38 private const string ConditionsName = "Conditions"; 39 private const string ComparisonsName = "Comparisons"; 40 private const string BooleanOperatorsName = "Boolean Operators"; 41 private const string ConditionalSymbolsName = "ConditionalSymbols"; 42 private const string TimeSeriesSymbolsName = "Time Series Symbols"; 32 43 33 44 [StorableConstructor] … … 43 54 44 55 private void Initialize() { 56 #region symbol declaration 45 57 var add = new Addition(); 46 58 var sub = new Subtraction(); … … 53 65 var log = new Logarithm(); 54 66 var pow = new Power(); 55 pow.InitialFrequency = 0.0;56 67 var root = new Root(); 57 root.InitialFrequency = 0.0;58 68 var exp = new Exponential(); 59 69 var @if = new IfThenElse(); … … 63 73 var or = new Or(); 64 74 var not = new Not(); 75 var variableCondition = new VariableCondition(); 65 76 66 77 var timeLag = new TimeLag(); 67 timeLag.InitialFrequency = 0.0;68 78 var integral = new Integral(); 69 integral.InitialFrequency = 0.0;70 79 var derivative = new Derivative(); 71 derivative.InitialFrequency = 0.0;72 var variableCondition = new VariableCondition();73 variableCondition.InitialFrequency = 0.0;74 80 75 81 var constant = new Constant(); 76 82 constant.MinValue = -20; 77 83 constant.MaxValue = 20; 78 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();84 var variableSymbol = new Variable(); 79 85 var laggedVariable = new LaggedVariable(); 86 #endregion 80 87 81 laggedVariable.InitialFrequency = 0.0; 82 mean.InitialFrequency = 0.0; 88 #region group symbol declaration 89 var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean }); 90 var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan }); 91 var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log }); 92 var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol }); 93 var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, terminalSymbols }); 83 94 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 */ 95 var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { pow, root }); 108 96 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 }; 97 var conditionSymbols = new GroupSymbol(ConditionsName, new List<ISymbol> { @if, variableCondition }); 98 var comparisonSymbols = new GroupSymbol(ComparisonsName, new List<ISymbol> { gt, lt }); 99 var booleanOperationSymbols = new GroupSymbol(BooleanOperatorsName, new List<ISymbol> { and, or, not }); 100 var conditionalSymbols = new GroupSymbol(ConditionalSymbolsName, new List<ISymbol> { conditionSymbols, comparisonSymbols, booleanOperationSymbols }); 110 101 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 };102 var timeSeriesSymbols = new GroupSymbol(TimeSeriesSymbolsName, new List<ISymbol> { timeLag, integral, derivative, laggedVariable }); 103 #endregion 113 104 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); 105 AddSymbol(realValuedSymbols); 106 AddSymbol(powerSymbols); 107 AddSymbol(conditionalSymbols); 108 AddSymbol(timeSeriesSymbols); 120 109 121 foreach (var symb in allSymbols) 122 AddSymbol(symb); 123 124 foreach (var unaryFun in unaryFunctionSymbols.Concat(unaryBooleanFunctionSymbols)) { 125 SetSubtreeCount(unaryFun, 1, 1); 126 } 127 foreach (var binaryFun in binaryFunctionSymbols.Concat(binaryBooleanFunctionSymbols).Concat(relationalFunctionSymbols)) { 128 SetSubtreeCount(binaryFun, 2, 2); 129 } 130 131 foreach (var terminalSymbol in terminalSymbols) { 132 SetSubtreeCount(terminalSymbol, 0, 0); 133 } 110 #region subtree count configuration 111 SetSubtreeCount(arithmeticSymbols, 2, 2); 112 SetSubtreeCount(trigonometricSymbols, 1, 1); 113 SetSubtreeCount(powerSymbols, 2, 2); 114 SetSubtreeCount(exponentialAndLogarithmicSymbols, 1, 1); 115 SetSubtreeCount(terminalSymbols, 0, 0); 134 116 135 117 SetSubtreeCount(@if, 3, 3); 118 SetSubtreeCount(variableCondition, 2, 2); 119 SetSubtreeCount(comparisonSymbols, 2, 2); 120 SetSubtreeCount(and, 2, 2); 121 SetSubtreeCount(or, 2, 2); 122 SetSubtreeCount(not, 1, 1); 123 124 SetSubtreeCount(timeLag, 1, 1); 125 SetSubtreeCount(integral, 1, 1); 126 SetSubtreeCount(derivative, 1, 1); 127 SetSubtreeCount(laggedVariable, 0, 0); 128 #endregion 129 130 #region alloed child symbols configuration 131 AddAllowedChildSymbol(StartSymbol, realValuedSymbols); 132 AddAllowedChildSymbol(DefunSymbol, realValuedSymbols); 133 134 AddAllowedChildSymbol(realValuedSymbols, realValuedSymbols); 135 AddAllowedChildSymbol(realValuedSymbols, powerSymbols); 136 AddAllowedChildSymbol(realValuedSymbols, conditionSymbols); 137 AddAllowedChildSymbol(realValuedSymbols, timeSeriesSymbols); 138 139 AddAllowedChildSymbol(powerSymbols, variableSymbol, 0); 140 AddAllowedChildSymbol(powerSymbols, constant, 1); 141 142 AddAllowedChildSymbol(@if, comparisonSymbols, 0); 143 AddAllowedChildSymbol(@if, booleanOperationSymbols, 0); 144 AddAllowedChildSymbol(@if, conditionSymbols, 1); 145 AddAllowedChildSymbol(@if, realValuedSymbols, 1); 146 AddAllowedChildSymbol(@if, powerSymbols, 1); 147 AddAllowedChildSymbol(@if, timeSeriesSymbols, 1); 148 AddAllowedChildSymbol(@if, conditionSymbols, 2); 149 AddAllowedChildSymbol(@if, realValuedSymbols, 2); 150 AddAllowedChildSymbol(@if, powerSymbols, 2); 151 AddAllowedChildSymbol(@if, timeSeriesSymbols, 2); 152 153 AddAllowedChildSymbol(booleanOperationSymbols, comparisonSymbols); 154 AddAllowedChildSymbol(comparisonSymbols, realValuedSymbols); 155 AddAllowedChildSymbol(comparisonSymbols, powerSymbols); 156 AddAllowedChildSymbol(comparisonSymbols, conditionSymbols); 157 AddAllowedChildSymbol(comparisonSymbols, timeSeriesSymbols); 158 159 AddAllowedChildSymbol(variableCondition, realValuedSymbols); 160 AddAllowedChildSymbol(variableCondition, powerSymbols); 161 AddAllowedChildSymbol(variableCondition, conditionSymbols); 162 AddAllowedChildSymbol(variableCondition, timeSeriesSymbols); 136 163 137 164 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 } 165 AddAllowedChildSymbol(timeLag, realValuedSymbols); 166 AddAllowedChildSymbol(timeLag, powerSymbols); 167 AddAllowedChildSymbol(timeLag, conditionSymbols); 143 168 144 foreach (var symb in unaryFunctionSymbols) { 145 foreach (var childSymb in realValuedSymbols) { 146 AddAllowedChildSymbol(symb, childSymb); 147 } 148 } 169 AddAllowedChildSymbol(integral, realValuedSymbols); 170 AddAllowedChildSymbol(integral, powerSymbols); 171 AddAllowedChildSymbol(integral, conditionSymbols); 149 172 150 foreach (var symb in binaryFunctionSymbols) {151 foreach (var childSymb in realValuedSymbols) {152 AddAllowedChildSymbol(symb, childSymb);153 }154 173 AddAllowedChildSymbol(derivative, realValuedSymbols); 174 AddAllowedChildSymbol(derivative, powerSymbols); 175 AddAllowedChildSymbol(derivative, conditionSymbols); 176 #endregion 177 } 155 178 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 179 public void ConfigureAsDefaultRegressionGrammar() { 180 Symbols.Where(s => s is Average).First().Enabled = false; 181 Symbols.Where(s => s.Name == TrigonometricFunctionsName).First().Enabled = false; 182 Symbols.Where(s => s.Name == PowerFunctionsName).First().Enabled = false; 183 Symbols.Where(s => s.Name == ConditionalSymbolsName).First().Enabled = false; 184 Symbols.Where(s => s.Name == TimeSeriesSymbolsName).First().Enabled = false; 185 } 163 186 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 } 187 public void ConfigureAsDefaultClassificationGrammar() { 188 Symbols.Where(s => s is Average).First().Enabled = false; 189 Symbols.Where(s => s.Name == TrigonometricFunctionsName).First().Enabled = false; 190 Symbols.Where(s => s.Name == ExponentialFunctionsName).First().Enabled = false; 191 Symbols.Where(s => s.Name == PowerFunctionsName).First().Enabled = false; 192 Symbols.Where(s => s.Name == TimeSeriesSymbolsName).First().Enabled = false; 179 193 } 180 194 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs
r6774 r6803 64 64 private ISymbolicExpressionTreeNode MacroExpand(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode node, IList<ISymbolicExpressionTreeNode> argumentTrees) { 65 65 List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(node.Subtrees); 66 while (node.Subtree sCount > 0) node.RemoveSubtree(0);66 while (node.SubtreeCount > 0) node.RemoveSubtree(0); 67 67 if (node.Symbol is InvokeFunction) { 68 68 var invokeSym = node.Symbol as InvokeFunction; … … 893 893 // x0 * x1 * .. * xn * -1 => x0 * x1 * .. * -xn 894 894 var lastSubTree = x.Subtrees.Last(); 895 x.RemoveSubtree(x.Subtree sCount - 1);895 x.RemoveSubtree(x.SubtreeCount - 1); 896 896 x.AddSubtree(Negate(lastSubTree)); // last is maybe a constant, prefer to negate the constant 897 897 } else { -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r6533 r6803 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 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Addition.cs
r5809 r6803 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 24 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;26 26 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 27 27 [StorableClass] 28 28 [Item("Addition", "Symbol that represents the + operator.")] 29 29 public sealed class Addition : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = byte.MaxValue; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Addition(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/And.cs
r5809 r6803 28 28 [Item("And", "Symbol that represents the boolean AND operator.")] 29 29 public sealed class And : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = byte.MaxValue; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private And(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Average.cs
r5809 r6803 28 28 [Item("Average", "Symbol that represents the average (arithmetic mean) function.")] 29 29 public sealed class Average : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = byte.MaxValue; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Average(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Constant.cs
r5809 r6803 88 88 } 89 89 90 private const int minimumArity = 0; 91 private const int maximumArity = 0; 92 93 public override int MinimumArity { 94 get { return minimumArity; } 95 } 96 public override int MaximumArity { 97 get { return maximumArity; } 98 } 90 99 #endregion 100 91 101 [StorableConstructor] 92 102 private Constant(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Cosine.cs
r5809 r6803 28 28 [Item("Cosine", "Symbol that represents the cosine function.")] 29 29 public sealed class Cosine : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = 1; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Cosine(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Derivative.cs
r5809 r6803 28 28 [Item("Derivative", "Represents the derivative over the specified subtree.")] 29 29 public sealed class Derivative : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = 1; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Derivative(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Division.cs
r5809 r6803 28 28 [Item("Division", "Symbol that represents the / operator.")] 29 29 public sealed class Division : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = byte.MaxValue; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Division(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Exponential.cs
r5809 r6803 28 28 [Item("Exponential", "Symbol that represents the exponential function.")] 29 29 public sealed class Exponential : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = 1; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Exponential(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/GreaterThan.cs
r5809 r6803 28 28 [Item("GreaterThan", "Symbol that represents a greater than relation.")] 29 29 public sealed class GreaterThan : Symbol { 30 private const int minimumArity = 2; 31 private const int maximumArity = 2; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private GreaterThan(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/IfThenElse.cs
r5809 r6803 28 28 [Item("IfThenElse", "Symbol that represents a conditional operator.")] 29 29 public sealed class IfThenElse : Symbol { 30 private const int minimumArity = 3; 31 private const int maximumArity = 3; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private IfThenElse(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Integral.cs
r5809 r6803 27 27 [Item("Integral", "Represents the integral over the specified subtree.")] 28 28 public sealed class Integral : LaggedSymbol { 29 private const int minimumArity = 1; 30 private const int maximumArity = 1; 31 32 public override int MinimumArity { 33 get { return minimumArity; } 34 } 35 public override int MaximumArity { 36 get { return maximumArity; } 37 } 38 29 39 [StorableConstructor] 30 40 private Integral(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LessThan.cs
r5809 r6803 28 28 [Item("LessThan", "Symbol that represents a less than relation.")] 29 29 public sealed class LessThan : Symbol { 30 private const int minimumArity = 2; 31 private const int maximumArity = 2; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private LessThan(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Logarithm.cs
r5809 r6803 28 28 [Item("Logarithm", "Symbol that represents the logarithm function.")] 29 29 public sealed class Logarithm : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = 1; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Logarithm(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Multiplication.cs
r5809 r6803 28 28 [Item("Multiplication", "Symbol that represents the * operator.")] 29 29 public sealed class Multiplication : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = byte.MaxValue; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Multiplication(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Not.cs
r5809 r6803 28 28 [Item("Not", "Symbol that represents the boolean NOT operator.")] 29 29 public sealed class Not : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = 1; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Not(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Or.cs
r5809 r6803 28 28 [Item("Or", "Symbol that represents the boolean OR operator.")] 29 29 public sealed class Or : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = byte.MaxValue; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Or(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Power.cs
r5809 r6803 28 28 [Item("Power", "Symbol that represents the power function.")] 29 29 public sealed class Power : Symbol { 30 private const int minimumArity = 2; 31 private const int maximumArity = 2; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Power(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Root.cs
r5809 r6803 28 28 [Item("Root", "Symbol that represents the n-th root function.")] 29 29 public sealed class Root : Symbol { 30 private const int minimumArity = 2; 31 private const int maximumArity = 2; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Root(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sine.cs
r5809 r6803 28 28 [Item("Sine", "Symbol that represents the sine function.")] 29 29 public sealed class Sine : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = 1; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Sine(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Subtraction.cs
r5809 r6803 28 28 [Item("Subtraction", "Symbol that represents the - operator.")] 29 29 public sealed class Subtraction : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = byte.MaxValue; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Subtraction(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Tangent.cs
r5809 r6803 28 28 [Item("Tangent", "Symbol that represents the tangent trigonometric function.")] 29 29 public sealed class Tangent : Symbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = 1; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private Tangent(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/TimeLag.cs
r5809 r6803 28 28 [Item("TimeLag", "Represents a symblol whose evaluation is shifted.")] 29 29 public sealed class TimeLag : LaggedSymbol { 30 private const int minimumArity = 1; 31 private const int maximumArity = 1; 32 33 public override int MinimumArity { 34 get { return minimumArity; } 35 } 36 public override int MaximumArity { 37 get { return maximumArity; } 38 } 39 30 40 [StorableConstructor] 31 41 private TimeLag(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
r5809 r6803 100 100 } 101 101 } 102 103 private const int minimumArity = 0; 104 private const int maximumArity = 0; 105 106 public override int MinimumArity { 107 get { return minimumArity; } 108 } 109 public override int MaximumArity { 110 get { return maximumArity; } 111 } 102 112 #endregion 113 103 114 [StorableConstructor] 104 115 protected Variable(bool deserializing) … … 126 137 } 127 138 139 protected override void OnChanged(EventArgs e) { 140 if (@Fixed) { 141 weightManipulatorMu = 1; 142 weightManipulatorSigma = 0; 143 weightMu = 1; 144 weightSigma = 0; 145 multiplicativeWeightManipulatorSigma = 0; 146 } 147 base.OnChanged(e); 148 } 149 128 150 public override ISymbolicExpressionTreeNode CreateTreeNode() { 129 151 return new VariableTreeNode(this); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs
r5809 r6803 138 138 } 139 139 } 140 141 private const int minimumArity = 2; 142 private const int maximumArity = 2; 143 144 public override int MinimumArity { 145 get { return minimumArity; } 146 } 147 public override int MaximumArity { 148 get { return maximumArity; } 149 } 140 150 #endregion 141 151
Note: See TracChangeset
for help on using the changeset viewer.