Optimization running. Error running optimization. Too many input arguments.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I am working on genetic algorithm toolbox but i have a problem with creation function. i want to initialize real valued population by using creation function. my function is ;
function Chrom = crtrp(Nind,FieldDR) Chrom = rand(Nind,Nvar) .* FieldDR; end
in an another m. file, i identified FieldDR for boundaries. Is this a true approach? when i run the program the error occurs as
Error running optimization. Too many input arguments.
i could not understand why this occurs. Thanks.
PS: I am using MATLAB 2010a and Optimization Toolbox 5.0
0 Commenti
Risposta accettata
Alan Weiss
il 7 Mag 2012
According to the documentation http://www.mathworks.com/help/toolbox/gads/f6174dfi10.html#f14223 the syntax for a creation function is
function Population = myfun(GenomeLength, FitnessFcn, options)
The input arguments to the function are
Genomelength — Number of independent variables for the fitness function
FitnessFcn — Fitness function
options — Options structure
The function returns Population, the initial population for the genetic algorithm.
Does your creation function satisfy this syntax? I really can't tell, but I am sure you can tell. Also, as you probably know, you must tell GA to use your creation function by setting the CreationFunction option to your creation function.
Alan Weiss
MATLAB mathematical toolbox documentation
0 Commenti
Più risposte (3)
Alan Weiss
il 8 Mag 2012
I am not sure I understand what you mean when you say "I could not create "options" in this function." GA passes the existing options to your creation function, your function can query and use the values if you like, or ignore them if you like.
I do not understand your next statements either. Sorry.
Alan Weiss
MATLAB mathematical toolbox documentation
0 Commenti
Vedere anche
Categorie
Scopri di più su Genetic Algorithm in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!