I want to write two objective functions based on NSGA2
genetic algorithm in Matlab, However, i'm confusing to input chromosomes to evaluate my objectives, and in my objective function, the chromosomes are unused, I don't know how to evaluate Objective function according to chromosomes where my function call is evaluateObjective(chromosome(ii,:), V)
and I'v following parameters to input.
S = [0.9 0.8 0.3 0.3];
W = [0.9 0.7 0.4 0.1];
P = [15 17 18];
T = [13 14 13];
V=4;
My desire Function:
Obj1: for all w belongs to W and p belongs to P
summation of (w*p)
Obj2: for all t belongs to T and s belongs to S
summation of (t*s)
And the objective function:
function f = evaluateObjective(x, V) %x is the choromosome
% Objective function 1
sum = 0;
for i = 1 : V - 1
sum = sum - W((i))*P;
end
f(1) = sum;
% Objective function 2
sum = 0;
for i = 1 : V
sum = sum + S*S(i);
end
f(2) = sum;
end