- pass in an CreationFcn that uses only the permitted values
- supply your own CrossoverFcn and MutationFcn, which "just happen" to satisfy your requirement each time
How to control the step length or accuracy of decision variables X in gamultiobj? I need the X just be assigned as 0.001, 0.002 or 0.02, instead of 0.001234.
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I use the funtion gamultiobj. I need the decision variables X just be assigned as 0.001, 0.002 or 0.02, instead of 0.001234. Is there a method to control the step length or accuracy of decision variables X in the multiobjective optimization?
[X,Fval,exitFlag,Output]=gamultiobj(FitnessFunction,numberOfVariables,A,b,Aeq,beq,lb,ub,options);
0 Commenti
Risposte (1)
Walter Roberson
il 10 Giu 2018
gamultiobj is not designed for discrete variables.
What you have to do is use the options structure:
3 Commenti
Sonja Kallio
il 27 Gen 2021
Could you give us an example how to write CreationFcn with prmitted values?
I have CreationFcn which uses a for loop to create the Initial Population.
There is 3 decision variables which are varied by the for loop.
Should I define the permitted values somehow in the function, for example like this:
x(1) = (1:1:10)
Best regards,
Sonja Kallio
Walter Roberson
il 28 Gen 2021
Assuming for a moment that you are using integer variables and that lb and ub have been set appropriately,
for iter = 1 : population size
for var = 1 : nvars
x(var) = randi([lb(var), ub(var)]);
end
population(iter,:) = x;
end
Vedere anche
Categorie
Scopri di più su Surrogate Optimization 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!