Changeset 15832 for branches/2886_SymRegGrammarEnumeration/Test
- Timestamp:
- 03/08/18 10:54:04 (6 years ago)
- Location:
- branches/2886_SymRegGrammarEnumeration/Test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2886_SymRegGrammarEnumeration/Test/GrammarEnumerationTest.cs
r15821 r15832 72 72 }); 73 73 74 int targetSolutionHash = alg.Grammar. CalcHashCode(targetSolution);75 int actualSolutionHash = alg.Grammar. CalcHashCode(alg.BestTrainingSentence);74 int targetSolutionHash = alg.Grammar.Hasher.CalcHashCode(targetSolution); 75 int actualSolutionHash = alg.Grammar.Hasher.CalcHashCode(alg.BestTrainingSentence); 76 76 77 77 Assert.IsTrue(alg.DistinctSentencesLength.ContainsKey(targetSolutionHash), "Actual solution was not generated!"); … … 127 127 }); 128 128 129 int targetSolutionHash = alg.Grammar. CalcHashCode(targetSolution);130 int actualSolutionHash = alg.Grammar. CalcHashCode(alg.BestTrainingSentence);129 int targetSolutionHash = alg.Grammar.Hasher.CalcHashCode(targetSolution); 130 int actualSolutionHash = alg.Grammar.Hasher.CalcHashCode(alg.BestTrainingSentence); 131 131 132 132 Assert.IsTrue(alg.DistinctSentencesLength.ContainsKey(targetSolutionHash), "Actual solution was not generated!"); … … 156 156 }); 157 157 158 int targetSolutionHash = alg.Grammar. CalcHashCode(targetSolution);159 int actualSolutionHash = alg.Grammar. CalcHashCode(alg.BestTrainingSentence);158 int targetSolutionHash = alg.Grammar.Hasher.CalcHashCode(targetSolution); 159 int actualSolutionHash = alg.Grammar.Hasher.CalcHashCode(alg.BestTrainingSentence); 160 160 161 161 Assert.IsTrue(alg.DistinctSentencesLength.ContainsKey(targetSolutionHash), "Actual solution was not generated!"); -
branches/2886_SymRegGrammarEnumeration/Test/TreeHashingTest.cs
r15824 r15832 28 28 SymbolString s2 = new SymbolString(new[] { varA, varB, grammar.Addition, varC, grammar.Addition }); 29 29 30 int hash1 = grammar. CalcHashCode(s1);31 int hash2 = grammar. CalcHashCode(s2);30 int hash1 = grammar.Hasher.CalcHashCode(s1); 31 int hash2 = grammar.Hasher.CalcHashCode(s2); 32 32 33 33 Assert.AreEqual(hash1, hash2); … … 40 40 SymbolString s2 = new SymbolString(new[] { varB, varB, grammar.Addition, varB, grammar.Addition }); 41 41 42 int hash1 = grammar. CalcHashCode(s1);43 int hash2 = grammar. CalcHashCode(s2);42 int hash1 = grammar.Hasher.CalcHashCode(s1); 43 int hash2 = grammar.Hasher.CalcHashCode(s2); 44 44 45 45 Assert.AreNotEqual(hash1, hash2); … … 52 52 SymbolString s2 = new SymbolString(new[] { varB, varA, grammar.Addition }); 53 53 54 int hash1 = grammar. CalcHashCode(s1);55 int hash2 = grammar. CalcHashCode(s2);54 int hash1 = grammar.Hasher.CalcHashCode(s1); 55 int hash2 = grammar.Hasher.CalcHashCode(s2); 56 56 57 57 Assert.AreEqual(hash1, hash2); … … 64 64 SymbolString s2 = new SymbolString(new[] { varA, varB, varA, grammar.Addition, grammar.Addition }); 65 65 66 int hash1 = grammar. CalcHashCode(s1);67 int hash2 = grammar. CalcHashCode(s2);66 int hash1 = grammar.Hasher.CalcHashCode(s1); 67 int hash2 = grammar.Hasher.CalcHashCode(s2); 68 68 69 69 Assert.AreEqual(hash1, hash2); … … 76 76 SymbolString s2 = new SymbolString(new[] { varA }); 77 77 78 int hash1 = grammar. CalcHashCode(s1);79 int hash2 = grammar. CalcHashCode(s2);78 int hash1 = grammar.Hasher.CalcHashCode(s1); 79 int hash2 = grammar.Hasher.CalcHashCode(s2); 80 80 81 81 Assert.AreEqual(hash1, hash2); … … 88 88 SymbolString s2 = new SymbolString(new[] { varA, varA, varA, grammar.Multiplication, grammar.Addition }); 89 89 90 int hash1 = grammar. CalcHashCode(s1);91 int hash2 = grammar. CalcHashCode(s2);90 int hash1 = grammar.Hasher.CalcHashCode(s1); 91 int hash2 = grammar.Hasher.CalcHashCode(s2); 92 92 93 93 Assert.AreNotEqual(hash1, hash2); … … 100 100 SymbolString s2 = new SymbolString(new Symbol[] { varA, grammar.Expr, grammar.Addition }); 101 101 102 int hash1 = grammar. CalcHashCode(s1);103 int hash2 = grammar. CalcHashCode(s2);102 int hash1 = grammar.Hasher.CalcHashCode(s1); 103 int hash2 = grammar.Hasher.CalcHashCode(s2); 104 104 105 105 Assert.AreEqual(hash1, hash2); … … 114 114 SymbolString s2 = new SymbolString(new Symbol[] { varA, varB, grammar.Multiplication }); 115 115 116 int hash1 = grammar. CalcHashCode(s1);117 int hash2 = grammar. CalcHashCode(s2);116 int hash1 = grammar.Hasher.CalcHashCode(s1); 117 int hash2 = grammar.Hasher.CalcHashCode(s2); 118 118 119 119 Assert.AreEqual(hash1, hash2); … … 126 126 SymbolString s2 = new SymbolString(new Symbol[] { varA, varA, varA, grammar.Multiplication, grammar.Addition, grammar.Sin, varA, grammar.Inv, varA, grammar.Sin, varA, grammar.Multiplication, grammar.Multiplication, grammar.Addition }); 127 127 128 int hash1 = grammar. CalcHashCode(s1);129 int hash2 = grammar. CalcHashCode(s2);128 int hash1 = grammar.Hasher.CalcHashCode(s1); 129 int hash2 = grammar.Hasher.CalcHashCode(s2); 130 130 131 131 Assert.AreEqual(hash1, hash2);
Note: See TracChangeset
for help on using the changeset viewer.