-
Notifications
You must be signed in to change notification settings - Fork 0
/
GAconfig_example_perms
352 lines (330 loc) · 12.1 KB
/
GAconfig_example_perms
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#=============================================================================
# (c) Copyright Arthur L. Corcoran, 1992, 1993. All rights reserved.
#
# Genetic Algorithm configuration file
#=============================================================================
#-----------------------------------------------------------------------------
# User data file
# This information is not used by the GA, however, it is a convenient
# way to input a data file name or other information to your application.
#-----------------------------------------------------------------------------
# user_data datafile
#-----------------------------------------------------------------------------
# Seed for random number generator
#
# Usage: rand_seed my_pid
# rand_seed number
#
# my_pid = use system pid as random seed
# number = seed for random number generator, a positive integer
#
# DEFAULT: rand_seed 1
#-----------------------------------------------------------------------------
rand_seed my_pid
# rand_seed 1
#-----------------------------------------------------------------------------
# The data type of the allele
#
# Usage: datatype [bit | int | int_perm | real]
#
# bit = bit string
# int = integers
# int_perm = permutation of integers
# real = real numbers
#
# DEFAULT: int_perm
#-----------------------------------------------------------------------------
#datatype bit
# datatype int
datatype int_perm
# datatype real
#-----------------------------------------------------------------------------
# How to initialize the pool
#
# Usage: initpool [random | from_file filename | interactive]
#
# random = generate at random based on
# datatype, chrom_len, & pool_size
# from_file = read from a file
# filename = the name of the file to read from
# interactive = read from stdin
#
# DEFAULT: initpool random
#-----------------------------------------------------------------------------
# initpool random
# initpool from_file initpool.dat
# initpool interactive
# introduced by claudio:
#initpool random01
#initpool random
#-----------------------------------------------------------------------------
# Chromosome length, needed when "initpool random" selected
#
# Usage: chrom_len length
#
# length = chromosome length, a positive integer
#
# DEFAULT: chrom_len 10
#-----------------------------------------------------------------------------
chrom_len 6
#-----------------------------------------------------------------------------
# Pool size, needed when "initpool random" selected
#
# Usage: pool_size size
#
# size = pool size, a positive integer
#
# DEFAULT: 100
#-----------------------------------------------------------------------------
pool_size 100
#-----------------------------------------------------------------------------
# When to stop the GA
#
# Convergence means when the variance = 0, or equivalently, when
# all the fitness values in the pool are identical.
#
# Iterations means the number of generations for the generational model
# and the number of trials for the steady state model. Numbers must
# be given as positive integers. It takes roughly pool_size/2
# iterations of the steady state model to equal one iteration of
# the generational model.
#
# Usage: stop_after convergence
# stop_after number [use_convergence | ignore_convergence]
#
# convergence - stop when the GA converges
# number - stop after specified number of iterations
# use_convergence - will stop early if GA converges (default)
# ignore_convergence - WILL NOT stop early even if GA converges
#
# DEFAULT: stop_after convergence
#-----------------------------------------------------------------------------
# stop_after convergence
# stop_after 500
stop_after 100 use_convergence
# stop_after 50000 ignore_convergence
#-----------------------------------------------------------------------------
# GA Type:
#
# Usage: ga [generational | steady_state]
#
# generational = generational GA
# steady_state = steady-state GA
#
# WARNING: This directive has the following side effects:
#
# GA type Directives set as a side effect
# ------------ -------------------------------
# generational selection roulette
# replacement append
# rp_interval 1
#
# steady-state selection rank_biased
# replacement by_rank
# rp_interval 100
#
# DEFAULT: ga generational
#-----------------------------------------------------------------------------
# ga generational # most commonly used
# ga steady_state # used by Genitor
#-----------------------------------------------------------------------------
# Generation gap:
#
# The generation gap represents a percentage of the population to copy
# (clone) to the new pool at each generation. This only makes sense in
# a GA with two pools as in the generational model. A gap of 0.0
# is the traditional generational algorithm. As the gap increases,
# it becomes more like a steady-state algorithm. A gap of 1.0
# essentially disables crossover since only reproduction occurs.
#
# Usage: gap number
#
# number = generation gap, valid range = [0.0 .. 1.0]
#
# DEFAULT: gap 0.0
#-----------------------------------------------------------------------------
# gap 0.3
#-----------------------------------------------------------------------------
# Selection method:
#
# Usage: selection [roulette | rank_biased | uniform_random]
#
# roulette = Roulette wheel
# rank_biased = Ranked, biased selection as in Genitor
# uniform_random = Pick one at random
#
# DEFAULT: selection roulette
#-----------------------------------------------------------------------------
# selection roulette # use with generational GA
# selection rank_biased # use with steady-state GA
# selection uniform_random # experimental
#-----------------------------------------------------------------------------
# Selection bias
#
# Usage: bias number
#
# number = selection bias, valid range = [1.0 .. 2.0]
# Only used for rank_biased selection
#
# DEFAULT: bias 1.8
#-----------------------------------------------------------------------------
# bias 1.1
#-----------------------------------------------------------------------------
# Crossover method:
#
# Usage: crossover [simple | uniform | order1 | order2 | position | cycle |
# pmx | uox | rox | asexual]
#
# simple = children get alternate "halves" of parents
# uniform = alleles swapped uniformly
# order1 = order based
# order2 = order based
# position = order based
# cycle = order based
# pmx = order based
# uox = uniform order
# rox = relative order
# asexual = swap two alleles
#
# DEFAULT: crossover order1
#-----------------------------------------------------------------------------
#crossover simple
# crossover uniform
crossover order1 # use ony with integer permutations
# crossover order2 # use ony with integer permutations
# crossover position # use ony with integer permutations
# crossover cycle # use ony with integer permutations
# crossover pmx # use ony with integer permutations
# crossover uox # use ony with integer permutations
# crossover rox # use ony with integer permutations
# crossover asexual
#-----------------------------------------------------------------------------
# Crossover Rate
#
# Usage: x_rate number
#
# number = crossover rate (percentage), valid range = [0.0 .. 1.0]
# A crossover rate of 0.0 disables crossover
#
# DEFAULT: x_rate 1.0
#-----------------------------------------------------------------------------
x_rate 0.7
#-----------------------------------------------------------------------------
# Mutation method:
#
# Usage: mutation [simple_invert | simple_random | swap]
#
# simple_invert = invert a bit
# simple_random = random bit value
# swap = swap two alleles
#
# DEFAULT: mutation swap
#-----------------------------------------------------------------------------
#mutation simple_invert # use only with bits
# mutation simple_random # use only with bits
# mutation swap # use with any datatype
# mutation float_random
# mutation float_rnd_pert
# mutation float_gauss_pert
#mutation float_LS
# rnd float in [0..1] -- introduced by claudio 10/02/2004
#-----------------------------------------------------------------------------
# Mutation Rate
#
# Usage: mu_rate number
#
# number = mutation rate (percentage), valid range = [0.0 .. 1.0]
# A mutation rate of 0.0 disables mutation
#
# DEFAULT: mu_rate 0.0
#-----------------------------------------------------------------------------
mu_rate 0.9
#-----------------------------------------------------------------------------
# Replacement method:
#
# Usage: replacement [append | by_rank | first_weaker | weakest]
#
# append = append to new pool, as in generational GA
# by_rank = insert in sorted order, as in Genitor
# first_weaker = replace first weaker found in linear scan of pool
# weakest = replace weakest member of the pool
#
# DEFAULT: replacement append
#-----------------------------------------------------------------------------
# replacement append # use with roulette (generational GA)
# replacement by_rank # use with rank_biased (steady-state GA)
# replacement first_weaker # experimental
# replacement weakest # experimental
#-----------------------------------------------------------------------------
# Objective of GA:
#
# Usage: objective [minimize | maximize]
#
# minimize = minimize evaluation function
# maximize = maximize evaluation function
#
# DEFAULT: objective minimize
#-----------------------------------------------------------------------------
# objective minimize
# objective maximize
#-----------------------------------------------------------------------------
# Elitism
#
# Elitism has two actions. For a generational GA, elitism makes two copies
# of the best performer in the old pool and and places them in the new
# pool, thus ensuring the most fit chromosome survives. The other action
# works with both models. In this case, elitism picks the best two
# chromosomes from the parents and children. Thus, if a child is not as
# fit as either parent, it will not be placed in the new pool. Selecting
# elitism in LibGA performs both actions.
#
# Usage: elitism [true | false]
#
# true = ensure best members survive until next generation
# false = no guarantee best will survive
#
# DEFAULT: elitism true
#-----------------------------------------------------------------------------
# elitism true
elitism false
#-----------------------------------------------------------------------------
# Report type
#
# Usage: rp_type [none | minimal | short | long]
#
# none = output nothing
# minimal = output configuration and final result
# short = output minimal + statistics only
# long = output short + dump pool
#
# DEFAULT: rp_type short
#-----------------------------------------------------------------------------
# rp_type none
#rp_type minimal
rp_type short
# rp_type long
#-----------------------------------------------------------------------------
# Report interval
#
# Usage: rp_interval number
#
# number = interval between reports, a positive integer
#
# DEFAULT: rp_interval 1
#-----------------------------------------------------------------------------
rp_interval 10
#-----------------------------------------------------------------------------
# Output report filename
#
# Usage: rp_file file_name [file_mode]
#
# file_name = name of report file
# file_mode = optional file mode for fopen()
# a = append (DEFAULT)
# w = overwrite
#
# DEFAULT: (write to stdout)
#-----------------------------------------------------------------------------
# rp_file ga.out
# rp_file ga.out a
# rp_file ga.out w