Changeset 15975 for branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/Grammar.cs
 Timestamp:
 06/28/18 16:56:41 (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/GrammarEnumeration/Grammar.cs
r15974 r15975 24 24 public Symbol StartSymbol { get; private set; } 25 25 26 public Hasher<int> Hasher { get; }26 public Hasher<int> Hasher { get; private set; } 27 27 28 28 #region Symbols … … 77 77 public Grammar(string[] variables) : this(variables, Enum.GetValues(typeof(GrammarRule)).Cast<GrammarRule>()) { } 78 78 79 [StorableConstructor] 80 protected Grammar(bool deserializing) { 81 InitTreeParser(); 82 } 83 79 84 protected Grammar(Grammar original, Cloner cloner) : base(original, cloner) { 80 85 infixExpressionFormatter = cloner.Clone(original.infixExpressionFormatter); … … 83 88 VarTerminals = original.VarTerminals.Select(cloner.Clone).ToList(); 84 89 85 Var = cloner.Clone(original.Var);86 Expr = cloner.Clone(original.Expr);87 Term = cloner.Clone(original.Term);88 Factor = cloner.Clone(original.Factor);89 LogFactor = cloner.Clone(original.LogFactor);90 ExpFactor = cloner.Clone(original.ExpFactor);91 SinFactor = cloner.Clone(original.SinFactor);92 SimpleExpr = cloner.Clone(original.SimpleExpr);93 SimpleTerm = cloner.Clone(original.SimpleTerm);94 InvExpr = cloner.Clone(original.InvExpr);95 InvTerm = cloner.Clone(original.InvTerm);96 97 Addition = cloner.Clone(original.Addition);98 Multiplication = cloner.Clone(original.Multiplication);99 Log = cloner.Clone(original.Log);100 Exp = cloner.Clone(original.Exp);101 Sin = cloner.Clone(original.Sin);102 Inv = cloner.Clone(original.Inv);103 Const = cloner.Clone(original.Const);90 Var = (NonterminalSymbol)cloner.Clone(original.Var); 91 Expr = (NonterminalSymbol)cloner.Clone(original.Expr); 92 Term = (NonterminalSymbol)cloner.Clone(original.Term); 93 Factor = (NonterminalSymbol)cloner.Clone(original.Factor); 94 LogFactor = (NonterminalSymbol)cloner.Clone(original.LogFactor); 95 ExpFactor = (NonterminalSymbol)cloner.Clone(original.ExpFactor); 96 SinFactor = (NonterminalSymbol)cloner.Clone(original.SinFactor); 97 SimpleExpr = (NonterminalSymbol)cloner.Clone(original.SimpleExpr); 98 SimpleTerm = (NonterminalSymbol)cloner.Clone(original.SimpleTerm); 99 InvExpr = (NonterminalSymbol)cloner.Clone(original.InvExpr); 100 InvTerm = (NonterminalSymbol)cloner.Clone(original.InvTerm); 101 102 Addition = (TerminalSymbol)cloner.Clone(original.Addition); 103 Multiplication = (TerminalSymbol)cloner.Clone(original.Multiplication); 104 Log = (TerminalSymbol)cloner.Clone(original.Log); 105 Exp = (TerminalSymbol)cloner.Clone(original.Exp); 106 Sin = (TerminalSymbol)cloner.Clone(original.Sin); 107 Inv = (TerminalSymbol)cloner.Clone(original.Inv); 108 Const = (TerminalSymbol)cloner.Clone(original.Const); 104 109 105 110 StartSymbol = Expr; … … 240 245 public double EvaluatePhrase(SymbolString s, IRegressionProblemData problemData, bool optimizeConstants) { 241 246 SymbolicExpressionTree tree = ParseSymbolicExpressionTree(s); 247 242 248 return RSquaredEvaluator.Evaluate(problemData, tree, optimizeConstants); 243 249 }
Note: See TracChangeset
for help on using the changeset viewer.