optimization using genetic algorithm
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Walter Roberson
il 20 Giu 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 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!