Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/02/15 16:08:21 (9 years ago)
Author:
gkronber
Message:

#2283: several major extensions for grammatical optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization.Test/TestSolvers.cs

    r11727 r11730  
    3636        // E -> V | V+E | V-E | V*E | V/E | (E)
    3737        // V -> a .. j
     38        /* grammar has been change ... unit test not yet adapted
    3839        var prob = new SymbolicRegressionPoly10Problem();
    3940        var comb = 10;
    4041        TestDFS(prob, 1, comb);
    4142        TestDFS(prob, 2, comb);
    42 
     43       
    4344        comb = comb + 10 * 4 * comb + comb;
    4445        TestDFS(prob, 3, comb);
    4546        TestDFS(prob, 4, comb);
    46 
     47       
    4748        comb = comb + 10 * 4 * comb + 10; // ((E))
    4849        TestDFS(prob, 5, comb);
    4950        TestDFS(prob, 6, comb);
    50 
    51         comb = comb + 10 * 4 * comb + 10; // (((E)))
     51       
     52        comb = comb + 10 * 4 * comb + 10; // (((E)))  */
    5253        // takes too long
    5354        //TestDFS(prob, 7, comb);
     
    9697        // E -> V | V+E | V-E | V*E | V/E | (E)
    9798        // V -> a .. j
     99        /* grammar has been change ... unit test not yet adapted
    98100        var prob = new SymbolicRegressionPoly10Problem();
    99101        var comb = 10;
     
    109111        TestDFS(prob, 6, comb);
    110112
    111         comb = comb + 10 * 4 * comb + 10; // (((E)))
     113        comb = comb + 10 * 4 * comb + 10; // (((E))) */
    112114        // takes too long
    113115        //TestDFS(prob, 7, comb);
     
    117119
    118120    private void TestDFS(IProblem prob, int len, int numExpectedSols) {
    119       var solver = new ExhaustiveDepthFirstSearch(len);
     121      var solver = new ExhaustiveDepthFirstSearch(prob, len);
    120122      int numSols = 0;
    121123
    122       solver.SolutionEvaluated += (s, d) => { numSols++; };
     124      solver.SolutionEvaluated += (s, d) => { numSols++; Console.WriteLine(s); };
    123125
    124       solver.Run(prob, int.MaxValue);
     126      solver.Run(int.MaxValue);
    125127      Assert.AreEqual(numExpectedSols, numSols);
    126128    }
Note: See TracChangeset for help on using the changeset viewer.