- Timestamp:
- 02/02/15 20:41:11 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/Test/TestInstances.cs
r11747 r11865 146 146 Assert.AreEqual(89, p.Evaluate("?(m)(ll?(m)(r))mr")); 147 147 } 148 [TestMethod] 149 public void TestRoyalTreeProblem() { 150 var p = new RoyalTreeProblem(); 151 Console.WriteLine(p.Grammar); 152 153 } 148 154 149 [TestMethod] 155 150 public void TestRoyalRoadProblem() { … … 261 256 Assert.AreEqual(1.0, p.Evaluate("a*b+c*d+e*f+a*g*i+c*f*j"), 1.0E-7); 262 257 } 258 259 [TestMethod] 260 public void TestRoyalTreeProblem() { 261 var p = new RoyalTreeProblem(7); 262 Console.WriteLine(p.Grammar); 263 264 // examples from The Royal Tree Problem, a Benchmark for Single and Multi-population Genetic Programming (Punch, Zongker, Goodman) 265 Assert.AreEqual(4, p.Evaluate("ax"), 1.0E-7); 266 Assert.AreEqual(384.0, p.Evaluate("cbaxaxbaxaxbaxax"), 1.0E-7); 267 Assert.AreEqual(128.66, p.Evaluate("cbaxaxbaxaxbxx"), 1.0E-7); 268 Assert.AreEqual(64.66, p.Evaluate("cbaxaxxx"), 1.0E-7); 269 270 } 263 271 } 264 272 }
Note: See TracChangeset
for help on using the changeset viewer.