Prev: A error -Checksum mismatch. Taget code need to be rebuilt.
Next: QT clustering implementation/details?
From: Ze Yu on 19 Jan 2010 17:50 Hey guys, I was trying to program with integers using GA. I've found a demo code for GA dealing with integers (the "ga_demo.m" from http://www.mathworks.com/support/solutions/en/data/1-10PDHC/?solution=1-10PDHC) However, I noticed that there was no functions for crossover operator. Any idea how could I possibly do this?
From: Alan Weiss on 20 Jan 2010 07:56
Ze Yu wrote: > Hey guys, > I was trying to program with integers using GA. I've found a demo code > for GA dealing with integers (the "ga_demo.m" from > http://www.mathworks.com/support/solutions/en/data/1-10PDHC/?solution=1-10PDHC) > > > However, I noticed that there was no functions for crossover operator. > Any idea how could I possibly do this? Several of the built-in crossover functions maintain integer entries. See http://www.mathworks.com/access/helpdesk/help/toolbox/gads/f6174dfi10.html#f7820 I believe the following maintain integers: Scattered (@crossoverscattered), the default crossover function Single point (@crossoversinglepoint) Two point (@crossovertwopoint) You can easily write your own crossover function using the syntax in the section I just referenced. Just make sure that the resulting vectors are integers if the input vectors are. Alan Weiss MATLAB mathematical toolbox documentation |