1 | # Copyright 2006 by Sean Luke and George Mason University
|
---|
2 | # Licensed under the Academic Free License version 3.0
|
---|
3 | # See the file "LICENSE" for more information
|
---|
4 |
|
---|
5 | parent.0 = ../../gp/koza/koza.params
|
---|
6 |
|
---|
7 | # First, we're gonna change the number of trees in
|
---|
8 | # the individual, to accommodate the ADFs
|
---|
9 | # Each of our three trees uses a different tree constraints,
|
---|
10 | # tc0, tc1, tc2
|
---|
11 |
|
---|
12 | pop.subpop.0.species.ind.numtrees = 3
|
---|
13 |
|
---|
14 | # "The result-producing branch" (Koza-II p. 245)
|
---|
15 | pop.subpop.0.species.ind.tree.0 = ec.gp.GPTree
|
---|
16 | pop.subpop.0.species.ind.tree.0.tc = tc0
|
---|
17 | # "ADF0 body" (Koza-II p. 245)
|
---|
18 | pop.subpop.0.species.ind.tree.1 = ec.gp.GPTree
|
---|
19 | pop.subpop.0.species.ind.tree.1.tc = tc1
|
---|
20 | # "ADF1 body" (Koza-II p. 245)
|
---|
21 | pop.subpop.0.species.ind.tree.2 = ec.gp.GPTree
|
---|
22 | pop.subpop.0.species.ind.tree.2.tc = tc2
|
---|
23 |
|
---|
24 |
|
---|
25 |
|
---|
26 | # Now, let's define what tc0, tc1, and tc2 are.
|
---|
27 | # Each has a different function set, f0, f1, and f2
|
---|
28 |
|
---|
29 | gp.tc.size = 3
|
---|
30 |
|
---|
31 | gp.tc.0 = ec.gp.GPTreeConstraints
|
---|
32 | gp.tc.0.name = tc0
|
---|
33 | gp.tc.0.fset = f0
|
---|
34 | gp.tc.0.returns = nil
|
---|
35 | gp.tc.0.init = ec.gp.koza.HalfBuilder
|
---|
36 | gp.tc.0.init.growp = 0.5
|
---|
37 | gp.tc.0.init.min = 2
|
---|
38 | gp.tc.0.init.max = 6
|
---|
39 |
|
---|
40 | gp.tc.1 = ec.gp.GPTreeConstraints
|
---|
41 | gp.tc.1.name = tc1
|
---|
42 | gp.tc.1.fset = f1
|
---|
43 | gp.tc.1.returns = nil
|
---|
44 | gp.tc.1.init = ec.gp.koza.HalfBuilder
|
---|
45 | gp.tc.1.init.growp = 0.5
|
---|
46 | gp.tc.1.init.min = 2
|
---|
47 | gp.tc.1.init.max = 6
|
---|
48 |
|
---|
49 | gp.tc.2 = ec.gp.GPTreeConstraints
|
---|
50 | gp.tc.2.name = tc2
|
---|
51 | gp.tc.2.fset = f2
|
---|
52 | gp.tc.2.returns = nil
|
---|
53 | gp.tc.2.init = ec.gp.koza.HalfBuilder
|
---|
54 | gp.tc.2.init.growp = 0.5
|
---|
55 | gp.tc.2.init.min = 2
|
---|
56 | gp.tc.2.init.max = 6
|
---|
57 |
|
---|
58 |
|
---|
59 |
|
---|
60 | # Now, let's define the three function sets.
|
---|
61 |
|
---|
62 | gp.fs.size = 3
|
---|
63 |
|
---|
64 | gp.fs.0.name = f0
|
---|
65 | gp.fs.0.size = 8
|
---|
66 | gp.fs.0 = ec.gp.GPFunctionSet
|
---|
67 | gp.fs.0.func.0 = ec.app.lawnmower.func.LawnERC
|
---|
68 | gp.fs.0.func.0.nc = nc0
|
---|
69 | gp.fs.0.func.1 = ec.app.lawnmower.func.Left
|
---|
70 | gp.fs.0.func.1.nc = nc0
|
---|
71 | gp.fs.0.func.2 = ec.app.lawnmower.func.Mow
|
---|
72 | gp.fs.0.func.2.nc = nc0
|
---|
73 | gp.fs.0.func.3 = ec.app.lawnmower.func.V8a
|
---|
74 | gp.fs.0.func.3.nc = nc2
|
---|
75 | gp.fs.0.func.4 = ec.app.lawnmower.func.Progn2
|
---|
76 | gp.fs.0.func.4.nc = nc2
|
---|
77 | gp.fs.0.func.5 = ec.app.lawnmower.func.Frog
|
---|
78 | gp.fs.0.func.5.nc = nc1
|
---|
79 |
|
---|
80 | gp.fs.0.func.6 = ec.gp.ADF
|
---|
81 | gp.fs.0.func.6.nc = nc0
|
---|
82 | # tree 1 (the "ADF0 body")
|
---|
83 | gp.fs.0.func.6.tree = 1
|
---|
84 | gp.fs.0.func.6.name = ADF0
|
---|
85 |
|
---|
86 | gp.fs.0.func.7 = ec.gp.ADF
|
---|
87 | gp.fs.0.func.7.nc = nc1
|
---|
88 | # tree 1 (the "ADF1 body")
|
---|
89 | gp.fs.0.func.7.tree = 2
|
---|
90 | gp.fs.0.func.7.name = ADF1
|
---|
91 |
|
---|
92 |
|
---|
93 |
|
---|
94 | # It's interesting that in the "ADF0 body",
|
---|
95 | # FROG is not used, see Koza-II p. 245
|
---|
96 | gp.fs.1 = ec.gp.GPFunctionSet
|
---|
97 | gp.fs.1.name = f1
|
---|
98 | gp.fs.1.size = 5
|
---|
99 | gp.fs.1.func.0 = ec.app.lawnmower.func.LawnERC
|
---|
100 | gp.fs.1.func.0.nc = nc0
|
---|
101 | gp.fs.1.func.1 = ec.app.lawnmower.func.Left
|
---|
102 | gp.fs.1.func.1.nc = nc0
|
---|
103 | gp.fs.1.func.2 = ec.app.lawnmower.func.Mow
|
---|
104 | gp.fs.1.func.2.nc = nc0
|
---|
105 | gp.fs.1.func.3 = ec.app.lawnmower.func.V8a
|
---|
106 | gp.fs.1.func.3.nc = nc2
|
---|
107 | gp.fs.1.func.4 = ec.app.lawnmower.func.Progn2
|
---|
108 | gp.fs.1.func.4.nc = nc2
|
---|
109 |
|
---|
110 | # The "ADF1 body" -- see Koza-II p. 245
|
---|
111 | gp.fs.2 = ec.gp.GPFunctionSet
|
---|
112 | gp.fs.2.name = f2
|
---|
113 | gp.fs.2.size = 8
|
---|
114 | gp.fs.2.func.0 = ec.app.lawnmower.func.LawnERC
|
---|
115 | gp.fs.2.func.0.nc = nc0
|
---|
116 | gp.fs.2.func.1 = ec.app.lawnmower.func.Left
|
---|
117 | gp.fs.2.func.1.nc = nc0
|
---|
118 | gp.fs.2.func.2 = ec.app.lawnmower.func.Mow
|
---|
119 | gp.fs.2.func.2.nc = nc0
|
---|
120 | gp.fs.2.func.3 = ec.app.lawnmower.func.V8a
|
---|
121 | gp.fs.2.func.3.nc = nc2
|
---|
122 | gp.fs.2.func.4 = ec.app.lawnmower.func.Progn2
|
---|
123 | gp.fs.2.func.4.nc = nc2
|
---|
124 | gp.fs.2.func.5 = ec.app.lawnmower.func.Frog
|
---|
125 | gp.fs.2.func.5.nc = nc1
|
---|
126 | gp.fs.2.func.6 = ec.gp.ADFArgument
|
---|
127 | gp.fs.2.func.6.nc = nc0
|
---|
128 | gp.fs.2.func.6.name = ARG0
|
---|
129 | # argument 0 of the calling ADF ("ADF1")
|
---|
130 | gp.fs.2.func.6.arg = 0
|
---|
131 | gp.fs.2.func.7 = ec.gp.ADF
|
---|
132 | gp.fs.2.func.7.nc = nc0
|
---|
133 | # tree 1 (the "ADF0 body")
|
---|
134 | gp.fs.2.func.7.tree = 1
|
---|
135 | gp.fs.2.func.7.name = ADF0
|
---|
136 |
|
---|
137 |
|
---|
138 |
|
---|
139 |
|
---|
140 | #
|
---|
141 | # We specify our problem here
|
---|
142 | #
|
---|
143 |
|
---|
144 | eval.problem = ec.app.lawnmower.Lawnmower
|
---|
145 | eval.problem.data = ec.app.lawnmower.LawnmowerData
|
---|
146 | eval.problem.x = 8
|
---|
147 | eval.problem.y = 8
|
---|
148 |
|
---|
149 | stat.gather-full = true
|
---|
150 |
|
---|