开发者

Genetic algorithms-Java- Schema Theory

Hi I've been reading up on schema theory and whilst I do understand the theory behind it, I'm having a hard time trying to understand how it can be implemented in my genetic algorithm java code. Does anyone have a pseudo code for this? I'm supposed to define FOUR schemas that are of particular interest for the fitness functions of my program (e.g., 1*···* and 0*···*). I've no idea how to do this.

QUESTION

Implement a simple GA with fitness−proportionate selection, roulette-w开发者_如何学Cheel sampling, population size 100, single−point crossover rate pc = 0.7, and bitwise mutation rate pm = 0.001. Try it on the following fitness function: ƒ(x) = number of ones in x, where x is a chromosome of length 20. (I've coded this part)

Based on the code in the GA but on a separate file, define FOUR schemas that are of particular interest for the fitness functions of question 1 above (e.g., 1*···* and 0*···*). Re-run the GA as in question 1 (with the same parameters) and record at each generation how many instances there are in the population of each of these schemas


A schema is essentially, a genotype with some wildcards. So the schema 01** could refer to the genotypes 0100, 0101, 0110 or 0111.

The question is asking you to come up four relevant schemata for a one-counting fitness function. So you're interested in seeing how the number of ones increases over the run of the GA - your first schema might have just a few ones, and the rest as wildcards. You can then form the other schemata by replacing some of those wildcards with more ones.

It's then asking you to count, each generation, how many individuals in the population match each of these schemata - so if one your schemata was 11111***************, you'd count how many individuals had ones in the first five bits.


Jivlain's answer is very clear, but if you want more on the topic Goldberg's Genetic Algorithms in Search, Optimization, and Machine Learning has exhaustive coverage of schema theory and how to identify schematas for a given domain (with examples).


I have extensively coded in Genetic Algorithms, if you can be precise about your question, you can perhaps except a precise answer ... Moreover, to better understand Schema theory, consult book by Melanie Mitchell on GA. it's given there in a very lucid terms.

AViD

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜