matlab - How to avoid repetition of value in genetic algorithm output? -


i did genetic algorithm code below...

lb = [1 1 1 1 1 1 1 1 1 1]; ub = [10 10 10 10 10 10 10 10 10 10]; intcon = 1:10; [x,fval] = ga(fitnessfunction,10,[],[],[],[],lb,ub,[],intcon,options) 

i output "x" vector of size [1 10] example follows...

(my output eg:) x = 4     3     3     2     9     4     4     6     1     1 

but need output example,

(what want eg:) x = 2 10 3 8 1 6 4 9 5 7 

that should not repeated values , outputx should if size [1 10] .... in output repeated values... please can tell me how remove repetition... should set options that,.... please reply....

if output based on minimizing fitness function genetic algorithm have fastest version of fitness function:

min(sum(x)-a)^2

with "a" equal sum of n different numbers(ie 1 10 a=55) means every time sum of output different "a", cost of solution increase quadratically.

thanks experience can tell crossover between elite members can create large amount of poor solutions. suggest increase factor of mutation random numbers or mutation switch between chromosomes.

i not know why use genetic algorithm that, there many others algorithms finds solutions in better-faster way.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -