optimization using genetic algorithm
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
i have 4 variables to optimize in GA which each have Upper Bound 100% and Lower Bound 0%. i need the result didn't exceed 100% when all the variable is summed. how to sum up my 4 variables into 100%??what code i have to write??
%Constrain
UB = [1 1 1 1];
LB = [0 0 0 0];
eBangkit = [];
Individu = [];
eIndividu = [];
david = [];
Dadatfit = [];
Datfit = [];
summary = [];
eDadatfit = [];
efitnessmax = [];
eIndividuMax = [];
Bangkit = round(rand(Npop,Nbit*Nvar));
popsize = size(Bangkit,1);
for i = 1:Nvar
batas(i) = UB(i)-LB(i);
end
0 commentaires
Réponses (1)
Walter Roberson
le 20 Juin 2021
If you were using one of the Mathworks optimization functions such as ga() then you would use
A = [1 1 1 1]
b = 1
However you aappear to be writing your own ga code, so write whatever you want.
0 commentaires
Voir également
Catégories
En savoir plus sur Genetic Algorithm dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!