Line | |
---|
1 | // as described in Hasegawa, Genetic Programming - New Approaches and Successful Applications
|
---|
2 | PROBLEM DMAX
|
---|
3 | CODE <<
|
---|
4 | >>
|
---|
5 |
|
---|
6 | INIT <<
|
---|
7 | >>
|
---|
8 |
|
---|
9 | NONTERMINALS
|
---|
10 | Expr<<out double v>>.
|
---|
11 | Add3<<out double v>>.
|
---|
12 | Mul3<<out double v>>.
|
---|
13 |
|
---|
14 | TERMINALS
|
---|
15 | X1. X2.
|
---|
16 |
|
---|
17 | RULES
|
---|
18 | Expr<<out double v>> =
|
---|
19 | Mul3<<out v>>
|
---|
20 | | Add3<<out v>>
|
---|
21 | | X1 SEM << v = 0.95; >>
|
---|
22 | | X2 SEM << v = -1; >>
|
---|
23 | .
|
---|
24 |
|
---|
25 | Mul3<<out double v>> = LOCAL << double v1, v2, v3; >>
|
---|
26 | Expr<<out v1>> Expr<<out v2>> Expr<<out v3>> SEM << v = v1 * v2 * v3; >>
|
---|
27 | .
|
---|
28 |
|
---|
29 | Add3<<out double v>> = LOCAL << double v1, v2, v3; >>
|
---|
30 | Expr<<out v1>> Expr<<out v2>> Expr<<out v3>> SEM << v = v1 + v2 + v3; >>
|
---|
31 | .
|
---|
32 |
|
---|
33 | MAXIMIZE
|
---|
34 | <<
|
---|
35 | double v;
|
---|
36 | Expr(out v);
|
---|
37 | return v;
|
---|
38 | >>
|
---|
39 | END SymbRegKoza.
|
---|
Note: See
TracBrowser
for help on using the repository browser.