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 | # |
---|
6 | # This file roughly defines a typeless, Koza-I-style |
---|
7 | # generational GP system with a single tree (meaning |
---|
8 | # no ADFs or ADMs. We use Tournament selection instead |
---|
9 | # of Koza-style Fitness-proportionate selection because |
---|
10 | # fitness-proportionate selection, well, is kinda icky. |
---|
11 | # |
---|
12 | |
---|
13 | # We're derived some of this |
---|
14 | # from ../../simple/params, which defines |
---|
15 | # generational, basic evolutionary mechanisms, selection mechanisms... |
---|
16 | |
---|
17 | parent.0 = ../../simple/simple.params |
---|
18 | |
---|
19 | |
---|
20 | # |
---|
21 | # We define the fitness of an individual to use the traditional |
---|
22 | # Koza-style fitness metrics, just to make everyone happy :-) |
---|
23 | # |
---|
24 | |
---|
25 | pop.subpop.0.species.fitness = ec.gp.koza.KozaFitness |
---|
26 | |
---|
27 | # |
---|
28 | # We have a GP-specific initializer. But we'll keep the |
---|
29 | # statistics as a SimpleStatistics (defined in simple.params) |
---|
30 | |
---|
31 | init = ec.gp.GPInitializer |
---|
32 | |
---|
33 | |
---|
34 | # We have a single subpopulation containing a GPSpecies, |
---|
35 | # using GPIndividuals as the prototypical individual class. |
---|
36 | |
---|
37 | pop.subpop.0.species = ec.gp.GPSpecies |
---|
38 | pop.subpop.0.species.ind = ec.gp.GPIndividual |
---|
39 | |
---|
40 | # We retry 100 times for duplicates (this is the lil-gp default) |
---|
41 | # in our subpopulation 0 |
---|
42 | |
---|
43 | pop.subpop.0.duplicate-retries = 100 |
---|
44 | |
---|
45 | # That GPIndividual has a single tree, which uses the |
---|
46 | # "tc0" Tree Constraints (which we define below later) |
---|
47 | |
---|
48 | pop.subpop.0.species.ind.numtrees = 1 |
---|
49 | pop.subpop.0.species.ind.tree.0 = ec.gp.GPTree |
---|
50 | pop.subpop.0.species.ind.tree.0.tc = tc0 |
---|
51 | |
---|
52 | |
---|
53 | # The GPSpecies has 2 pipelines, Crossover and Reproduction, |
---|
54 | # chosen with 0.9 and 0.1 likelihood respectively. |
---|
55 | |
---|
56 | pop.subpop.0.species.pipe = ec.breed.MultiBreedingPipeline |
---|
57 | # Koza's decision here was odd... |
---|
58 | pop.subpop.0.species.pipe.generate-max = false |
---|
59 | # Subsidiary pipelines: |
---|
60 | pop.subpop.0.species.pipe.num-sources = 2 |
---|
61 | pop.subpop.0.species.pipe.source.0 = ec.gp.koza.CrossoverPipeline |
---|
62 | pop.subpop.0.species.pipe.source.0.prob = 0.9 |
---|
63 | pop.subpop.0.species.pipe.source.1 = ec.breed.ReproductionPipeline |
---|
64 | pop.subpop.0.species.pipe.source.1.prob = 0.1 |
---|
65 | |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | # |
---|
70 | # Here we define the default values for Crossover, |
---|
71 | # Reproduction, Mutation, as well as our selection |
---|
72 | # approaches (Koza I). These can be overridden on a per-species |
---|
73 | # level of course. |
---|
74 | # |
---|
75 | |
---|
76 | # Reproduction will use Tournament Selection |
---|
77 | breed.reproduce.source.0 = ec.select.TournamentSelection |
---|
78 | |
---|
79 | # Crossover will use Tournament Selection, try only 1 |
---|
80 | # time, have a max depth of 17, and use KozaNodeSelector |
---|
81 | gp.koza.xover.source.0 = ec.select.TournamentSelection |
---|
82 | gp.koza.xover.source.1 = same |
---|
83 | gp.koza.xover.ns.0 = ec.gp.koza.KozaNodeSelector |
---|
84 | gp.koza.xover.ns.1 = same |
---|
85 | gp.koza.xover.maxdepth = 17 |
---|
86 | # This is the default for Koza and lil-gp, though it's |
---|
87 | # a little wimpy; on the other hand, a higher number can |
---|
88 | # make things really slow |
---|
89 | gp.koza.xover.tries = 1 |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | # Point Mutation will use Tournament Selection, try only 1 |
---|
95 | # time, have a max depth of 17, and use KozaNodeSelector |
---|
96 | # and GROW for building. Also, Point Mutation uses a GrowBuilder |
---|
97 | # by default, with a default of min-depth=max-depth=5 |
---|
98 | # as shown a ways below |
---|
99 | gp.koza.mutate.source.0 = ec.select.TournamentSelection |
---|
100 | gp.koza.mutate.ns.0 = ec.gp.koza.KozaNodeSelector |
---|
101 | gp.koza.mutate.build.0 = ec.gp.koza.GrowBuilder |
---|
102 | gp.koza.mutate.maxdepth = 17 |
---|
103 | # This is the default for Koza and lil-gp, though it's |
---|
104 | # a little wimpy; on the other hand, a higher number can |
---|
105 | # make things really slow |
---|
106 | gp.koza.mutate.tries = 1 |
---|
107 | |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | # |
---|
112 | # The default tournament size for TournamentSelection is 7 |
---|
113 | # |
---|
114 | |
---|
115 | select.tournament.size = 7 |
---|
116 | |
---|
117 | |
---|
118 | |
---|
119 | |
---|
120 | # Since GROW is only used for subtree mutation, ECJ uses |
---|
121 | # the Koza-standard subtree mutation GROW values for the |
---|
122 | # default for GROW as a whole. This default is |
---|
123 | # min-depth=max-depth=5, which I don't like very much, |
---|
124 | # but hey, that's the standard. |
---|
125 | # This means that if someone decided to use GROW to generate |
---|
126 | # new individual trees, it's also use the defaults below |
---|
127 | # unless he overrided them locally. |
---|
128 | gp.koza.grow.min-depth = 5 |
---|
129 | gp.koza.grow.max-depth = 5 |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | # |
---|
134 | # We specify a few things about ADFs -- what kind |
---|
135 | # of stack they use, and what kind of context |
---|
136 | # |
---|
137 | |
---|
138 | gp.problem.stack = ec.gp.ADFStack |
---|
139 | gp.adf-stack.context = ec.gp.ADFContext |
---|
140 | |
---|
141 | # |
---|
142 | # Here we define the default values for KozaNodeSelection; |
---|
143 | # as always, these can be overridden by values hanging off |
---|
144 | # of the Crossover/Reproduction/Mutation/whatever pipelines, |
---|
145 | # like we did for node-building, but hey, whatever. |
---|
146 | # The default is 10% terminals, 90% nonterminals when possible, |
---|
147 | # 0% "always pick the root", 0% "pick any node" |
---|
148 | |
---|
149 | gp.koza.ns.terminals = 0.1 |
---|
150 | gp.koza.ns.nonterminals = 0.9 |
---|
151 | gp.koza.ns.root = 0.0 |
---|
152 | |
---|
153 | |
---|
154 | |
---|
155 | |
---|
156 | # You need to create at least one function set, |
---|
157 | # called "f0", which your first tree will use. |
---|
158 | # You don't need to include the class declaration here, |
---|
159 | # but it quiets warnings. |
---|
160 | |
---|
161 | gp.fs.size = 1 |
---|
162 | gp.fs.0 = ec.gp.GPFunctionSet |
---|
163 | gp.fs.0.name = f0 |
---|
164 | #fill the rest of this out on a per-problem basis |
---|
165 | |
---|
166 | |
---|
167 | # Here we define a single atomic type, "nil", which everyone will use. |
---|
168 | # There are no set types defined. |
---|
169 | |
---|
170 | gp.type.a.size = 1 |
---|
171 | gp.type.a.0.name = nil |
---|
172 | gp.type.s.size = 0 |
---|
173 | |
---|
174 | # Here we define one GPTreeConstraints object, "tc0", |
---|
175 | # which uses ec.gp.koza.HalfBuilder to create nodes, |
---|
176 | # only allows nodes from the GPFunctionSet "fset", |
---|
177 | # and has the single type "nil" as its tree type. |
---|
178 | # You don't need to include the class declaration here, |
---|
179 | # but it quiets warnings. |
---|
180 | |
---|
181 | gp.tc.size = 1 |
---|
182 | gp.tc.0 = ec.gp.GPTreeConstraints |
---|
183 | gp.tc.0.name = tc0 |
---|
184 | gp.tc.0.fset = f0 |
---|
185 | gp.tc.0.returns = nil |
---|
186 | |
---|
187 | # The tree uses an ec.gp.koza.HalfBuilder to create |
---|
188 | # itself initially. |
---|
189 | # HalfBuilder will pick GROW half the time and FULL |
---|
190 | # the other half, with a ramp from 2 to 6 inclusive. |
---|
191 | # By ramp we mean that it first picks a random number between |
---|
192 | # 2 and 6 inclusive. This then becomes the *maximum* tree size |
---|
193 | # (for the FULL approach, it's the tree size of the tree, for |
---|
194 | # GROW, the tree can get no bigger than this) |
---|
195 | |
---|
196 | gp.tc.0.init = ec.gp.koza.HalfBuilder |
---|
197 | |
---|
198 | # We set the default for HalfBuilder to be a ramp of 2--6, |
---|
199 | # with a grow probability of 0.5 |
---|
200 | gp.koza.half.min-depth = 2 |
---|
201 | gp.koza.half.max-depth = 6 |
---|
202 | gp.koza.half.growp = 0.5 |
---|
203 | |
---|
204 | |
---|
205 | |
---|
206 | |
---|
207 | # Here we define 7 GPNodeConstraints, nc0...nc6, which |
---|
208 | # describe nodes with 0...6 children respectively, which only |
---|
209 | # use a single type, "nil", for their argument and return types |
---|
210 | # You don't need to include the class declarations with everything |
---|
211 | # else below, but it quiets warnings |
---|
212 | |
---|
213 | gp.nc.size = 7 |
---|
214 | |
---|
215 | gp.nc.0 = ec.gp.GPNodeConstraints |
---|
216 | gp.nc.0.name = nc0 |
---|
217 | gp.nc.0.returns = nil |
---|
218 | gp.nc.0.size = 0 |
---|
219 | |
---|
220 | gp.nc.1 = ec.gp.GPNodeConstraints |
---|
221 | gp.nc.1.name = nc1 |
---|
222 | gp.nc.1.returns = nil |
---|
223 | gp.nc.1.size = 1 |
---|
224 | gp.nc.1.child.0 = nil |
---|
225 | |
---|
226 | gp.nc.2 = ec.gp.GPNodeConstraints |
---|
227 | gp.nc.2.name = nc2 |
---|
228 | gp.nc.2.returns = nil |
---|
229 | gp.nc.2.size = 2 |
---|
230 | gp.nc.2.child.0 = nil |
---|
231 | gp.nc.2.child.1 = nil |
---|
232 | |
---|
233 | gp.nc.3 = ec.gp.GPNodeConstraints |
---|
234 | gp.nc.3.name = nc3 |
---|
235 | gp.nc.3.returns = nil |
---|
236 | gp.nc.3.size = 3 |
---|
237 | gp.nc.3.child.0 = nil |
---|
238 | gp.nc.3.child.1 = nil |
---|
239 | gp.nc.3.child.2 = nil |
---|
240 | |
---|
241 | gp.nc.4 = ec.gp.GPNodeConstraints |
---|
242 | gp.nc.4.name = nc4 |
---|
243 | gp.nc.4.returns = nil |
---|
244 | gp.nc.4.size = 4 |
---|
245 | gp.nc.4.child.0 = nil |
---|
246 | gp.nc.4.child.1 = nil |
---|
247 | gp.nc.4.child.2 = nil |
---|
248 | gp.nc.4.child.3 = nil |
---|
249 | |
---|
250 | gp.nc.5 = ec.gp.GPNodeConstraints |
---|
251 | gp.nc.5.name = nc5 |
---|
252 | gp.nc.5.returns = nil |
---|
253 | gp.nc.5.size = 5 |
---|
254 | gp.nc.5.child.0 = nil |
---|
255 | gp.nc.5.child.1 = nil |
---|
256 | gp.nc.5.child.2 = nil |
---|
257 | gp.nc.5.child.3 = nil |
---|
258 | gp.nc.5.child.4 = nil |
---|
259 | |
---|
260 | gp.nc.6 = ec.gp.GPNodeConstraints |
---|
261 | gp.nc.6.name = nc6 |
---|
262 | gp.nc.6.returns = nil |
---|
263 | gp.nc.6.size = 6 |
---|
264 | gp.nc.6.child.0 = nil |
---|
265 | gp.nc.6.child.1 = nil |
---|
266 | gp.nc.6.child.2 = nil |
---|
267 | gp.nc.6.child.3 = nil |
---|
268 | gp.nc.6.child.4 = nil |
---|
269 | gp.nc.6.child.5 = nil |
---|
270 | |
---|
271 | |
---|
272 | |
---|