Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
s
to approximate
on generation 0
on generation 1
on generation 3
on generation 6
on generation 9
on generation 13
Figure 5.3: Graphical output produced by the function desired obtained
46
0 20 40 60 80 100 120 140 160
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Operators Evolution
generation
p
r
o
b
a
b
i
l
i
t
i
e
s
o
f
o
c
c
u
r
e
n
c
e
crossover
mutation
Figure 5.4: Graphical output produced by the function operator evolution
X1
mylog
cos
X1
X1 X1
plus
X1
sin
times
times
cos
X1
times
plus
X1
sin
plus
X1
times
Figure 5.5: Graphical output produced by the function drawtree
47
Chapter 6
Summary of toolbox
functions
The more than one hundred functions provided in the toolbox GPLAB can be
divided into dierent functional groups. What follows is a list of the functions
included in each group. The same function may be listed in more than one
group. For help on a particular function, use help <function name> in the
MATLAB prompt.
6.1 Demonstration functions
demo
demoparity
demoant
6.2 Running the algorithm and testing result
gplab
testind
6.3 Parameter and state setting
setparams
resetparams
resetstate
setoperators
48
addoperators
setfunctions
addfunctions
setterminals
addterminals
6.4 Automatic variable checking
These are called by gplab and should not be called by the user:
checkvarsparams
checkvarsstate
checkvarsdata
6.5 Description of parameter and state variables
availableparams
availablestate
6.6 Creation of new generations
genpop
generation
pickoperator
applyoperator
pickparents
applysurvival
updatestate
stopcondition
49
6.7 Creation of new individuals
initpop
fullinit
growinit
rampedinit
newind
maketree
6.8 Filtering of new individuals
validateinds
strictdepth
strictnodes
dyndepth
dynnodes
heavydyndepth
heavydynnodes
6.9 Protected and logical functions
mydivide
mylog
mylog2
mylog10
mysqrt
mypower
myif
kozadivide
kozasqrt
nand
nor
50
6.10 Articial ant functions
demoant
antmove
antleft
antright
antprogn2
antprogn3
antif
antfoodahead
antfitness
anttrail
6.11 Tree manipulation
maketree
treelevel
nodes
intronnodes
tree2str
findnode
swapnode
6.12 Data manipulation
xy2inout
anttrail
saveall
51
6.13 Expected number of children
absolute
rank85
rank89
calcpopexpected
6.14 Sampling
roulette
sus
tournament
lexictour
sampling
6.15 Genetic operators
crossover
mutation
6.16 Fitness
calcfitness
regfitness
antfitness
calcpopfitness
6.17 Diversity measures
uniquegen
hamming
52
6.18 Automatic operator probability adaptation
isoperator
setinitialprobs
automaticoperatorprobs
moveadaptwindow
addcredit
updateoperatorprobs
6.19 Runtime graphical output
These are called by gplab and should not be called by the user:
graphicsinit
graphicsstart
graphicscontinue
graphicsgenerations
6.20 Oine graphical output
desired obtained
accuracy complexity
plotpareto
operator evolution
drawtree
6.21 Utilitarian functions
explode
implode
scale
normalize
shuffle
orderby
53
intrand
countfind
findfirstindex
isvalid
ranking
fixdec
uniquenosort
6.22 Text input les
These are used in pairs. exp .txt (exponential) and quartic .txt (quar-
tic polynomial x
4
+ x
3
+ x
2
+ x) contain 21 equidistant points in the inter-
val 1 to +1. paritybit .txt contain all cases. santafetrail.txt and
santafepellets.txt contain, respectively, the Santa Fe articial ant trail and
the number of food pellets in it.
exp x.txt and exp y.txt
quartic x.txt and quartic y.txt
parity3bit x.txt and parity3bit y.txt
parity5bit x.txt and parity5bit y.txt
santafetrail.txt and santafepellets.txt
6.23 License le
license.txt
54
Bibliography
[1] The MathWorks. (2003)
http://www.mathworks.com/products/matlab/
[2] Baker, J.E.: Adaptive selection methods for genetic algorithms. In Grefen-
stette, J., editor, Proceedings of the First International Conference on Ge-
netic Algorithms and Their Applications, Hillsdale, NJ. Erlbaum (1985)
101-111
[3] Baker, J.E.: Reducing bias and ineciency in the selection algorithm. In
Grefenstette, J., editor, Proceedings of the Second International Conference
on Genetic Algorithms, Hillsdale, NJ. Erlbaum (1987) 1421
[4] Blickle, T.: Tournament selection. In Back, T., Fogel, D.B., Michalewicz,
Z.: Handbook of Evolutionary Computation, Bristol, UK and New York,
NY. Institute of Physics Publishing and Oxford University Press (1997)
C2.3:14
[5] Davis, L.: Adapting operator probabilities in genetic algorithms. In Schaf-
fer, J.D., editor, Proceedings of the Third International Conference on Ge-
netic Algorithms, San Mateo, CA. Morgan Kaufmann (1989) 6169
[6] Goldberg, D.E.: Genetic algorithms in search, optimization, and machine
learning, Reading, MA. Addison-Wesley (1989)
[7] Holland, J.H.: Adaptation in natural and articial systems, Ann Arbor,
MI. University of Michigan Press (1975)
[8] Koza, J.R.: Genetic programming on the programming of computers by
means of natural selection, Cambridge, MA. MIT Press (1992)
[9] Luke, S., Panait, L.: Lexicographic parsimony pressure. In Langdon, W.B.,
Cant u-Paz, E., Mathias, K., Roy, R., Davis, D., Poli, R. Balakrish-
nan, K., Honavar, V., Rudolph, G., Wegener, J., Bull, L., Potter, M.A.,
Schultz, A.C., Miller, J.F., Burke, E., Jonoska, N., editors, Proceedings of
GECCO-2002, San Francisco, CA. Morgan Kaufmann (2002) 829836
[10] Montana, D.J., Davis, L.: Training feedforward neural networks using ge-
netic algorithms. In Proceedings of the International Joint Conference on
Articial Intelligence (1989) 762-767
55
[11] Silva, S., Almeida, J.: Dynamic maximum tree depth - a simple tech-
nique for avoiding bloat in tree-based GP. In E. Cant u-Paz, Foster, J.A.,
Deb, K., Davis, L.D., Roy, R., OReilly, U.-M., Beyer, H.-G., Standish, R.,
Kendall, G., Wilson, S., Harman, M., Wegener, J., Dasgupta, D., Pot-
ter, M.A., Schultz, A.C., Dowsland, K.A., Jonoska, N., Miller, J., editors,
Proceedings of GECCO-2003, Berlin. Springer Verlag (2003) 17761787
[12] Silva, S., Costa, E.: Dynamic limits for bloat control - variations on size
and depth. To appear in Proceedings of GECCO-2004, Berlin. Springer
Verlag (2004)
56