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