Changeset 10423


Ignore:
Timestamp:
01/29/14 15:02:11 (6 years ago)
Author:
gkronber
Message:

#2026 updated examples

Location:
branches/HeuristicLab.Problems.GPDL/Examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GPDL/Examples/OneMaxBinary.txt

    r10415 r10423  
    1 // special adaptation of the one-max problem
    2 // must find maximal number of 1-terminals
    3 // optimal solution = 32, number of solutions 2^32
     1// special adaptation of the one-max problem for tree representations
     2// must find maximal number of 1-terminals (maximum for a limited tree height h is 2 ^ (h - 1) )
     3
     4// the actual grammar:
     5// E -> 0 | 1 | E E
     6//
     7// leading to example tree:
     8//   E
     9//  / \
     10// 0   E
     11//    / \
     12//   1   0
     13// with a value of 1
     14//
     15// optimal tree for height = 3 has the value 4
     16//       E
     17//     /   \
     18//    E     E
     19//   / \   / \
     20//  1   1 1   1
     21
     22
     23// because of constraints of the implemented solvers we have to express the grammar differently
     24//
     25// E -> T | N
     26// N -> E E
     27// T -> A | B     // A has value 0, B has value 1
     28
    429PROBLEM OneMaxBinary
    530
    631NONTERMINALS
    7   S<<out int n>>.
    8   U<<out int n>>.
    9   V<<out int n>>.
    10   W<<out int n>>.
    11   X<<out int n>>.
    12   Y<<out int n>>.
     32  E<<out int n>>.
    1333  T<<out int n>>.
     34  N<<out int n>>.
    1435
    1536TERMINALS
     
    1839
    1940RULES
    20   S<<out int n>> =                                LOCAL << int n1, n2; >>
    21     U<<out n1>> U<<out n2>>                       SEM << n = n1 + n2; >>
    22   .
    23   U<<out int n>> =                                LOCAL << int n1, n2; >>
    24     V<<out n1>> V<<out n2>>                       SEM << n = n1 + n2; >>
    25   .
    26   V<<out int n>> =                                LOCAL << int n1, n2; >>
    27     W<<out n1>> W<<out n2>>                       SEM << n = n1 + n2; >>
    28   .
    29   W<<out int n>> =                                LOCAL << int n1, n2; >>
    30     X<<out n1>> X<<out n2>>                       SEM << n = n1 + n2; >>
    31   .
    32   // 2^32 solutions
    33   X<<out int n>> =                                LOCAL << int n1, n2; >>
    34     T<<out n1>> T<<out n2>>                       SEM << n = n1 + n2; >>
     41  E<<out int n>> =
     42    T<<out n>>
     43    | N<<out n>>
    3544  .
    3645
    37   // uncomment for 2^64 solutions
    38   // X<<out int n>> =                                LOCAL << int n1, n2; >>
    39   //   Y<<out n1>> Y<<out n2>>                       SEM << n = n1 + n2; >>
    40   // .
    41 
    42   Y<<out int n>> =                                LOCAL << int n1, n2; >>
    43     T<<out n1>> T<<out n2>>                       SEM << n = n1 + n2; >>
     46  N<<out int n>> =                                LOCAL << int n1, n2; >>
     47    E<<out n1>> E<<out n2>>                       SEM << n = n1 + n2; >>
    4448  .
    45 
     49 
    4650  T<<out int n>> =
    47     A                                             SEM << n = 1; >>
    48     | B                                           SEM << n = 0; >>
     51    A                                             SEM << n = 0; >>
     52    | B                                           SEM << n = 1; >>
    4953  .
    5054
     
    5256  <<
    5357    int n;
    54     S(out n);
     58    E(out n);
    5559    return (double) n;
    5660  >>
  • branches/HeuristicLab.Problems.GPDL/Examples/RoyalTree.txt

    r10080 r10423  
    11/* The Royal Tree benchmark problem for GP */
    22/* See paper: William F. Punch, How Effective are Multiple Populations in Genetic Programming */
    3 /* for max. depth 7 (level: g) this is hard to solve. Full enumeration needs a lot of memory. */
     3/* for max. depth 7 (level: g) this is hard to solve. */
    44
    55PROBLEM RoyalTree
Note: See TracChangeset for help on using the changeset viewer.