Changeset 10423
 Timestamp:
 01/29/14 15:02:11 (7 years ago)
 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 onemax problem 2 // must find maximal number of 1terminals 3 // optimal solution = 32, number of solutions 2^32 1 // special adaptation of the onemax problem for tree representations 2 // must find maximal number of 1terminals (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 4 29 PROBLEM OneMaxBinary 5 30 6 31 NONTERMINALS 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>>. 13 33 T<<out int n>>. 34 N<<out int n>>. 14 35 15 36 TERMINALS … … 18 39 19 40 RULES 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>> 35 44 . 36 45 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; >> 44 48 . 45 49 46 50 T<<out int n>> = 47 A SEM << n = 1; >>48  B SEM << n = 0; >>51 A SEM << n = 0; >> 52  B SEM << n = 1; >> 49 53 . 50 54 … … 52 56 << 53 57 int n; 54 S(out n);58 E(out n); 55 59 return (double) n; 56 60 >> 
branches/HeuristicLab.Problems.GPDL/Examples/RoyalTree.txt
r10080 r10423 1 1 /* The Royal Tree benchmark problem for GP */ 2 2 /* 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. */ 4 4 5 5 PROBLEM RoyalTree
Note: See TracChangeset
for help on using the changeset viewer.