Objective function of GA
4 views (last 30 days)
Show older comments
I want to do Genetic algorithm program in MATLAB. But, I'm unable to solve the objective function
My objective function is sumzfinal of this following code.
ii=M;
jj=P;
ll=C;
t = [0.0 0.5 0.0 0.0 5.0 0.0 1.5
2.5 2.0 0.0 4.5 0.0 1.5 0.0
0.0 2.5 0.0 0.0 3.5 0.5 0.5
2.5 0.0 0.0 1.0 0.0 0.5 0.0
0.0 0.0 3.0 0.0 1.0 0.0 2.0];
N = [5 5 3 5.5 9.5 2.5 4];
T = input ('Enter the available time on machine:');
for j=1:jj
for i=1:ii
w1(i,j)=t(i,j)*N(1,j)
w(i,j)=w1(i,j)/T
end
end
for l1=1:ll
for j1=1:jj
summ1=0.0;
sumx1=0.0;
for i1=1:ii
m1(l1,j1)=x(i1,l1)*w(i1,j1)%total load of cell l induced by part j(for a fixed value of l and j and differerent value of i multiplying x and w)
summ1=summ1+m1(l1,j1)
x1(i1,l1)=x(i1,l1)% no of machine in cell l
sumx1=sumx1+x1(i1,l1)
end
m(l1,j1)=summ1/sumx1% avarege cell load
end
end
sumzfinal=0.0;
for i2=1:ii
for l2=1:ll
sumy1=0.0;
sumz1=0.0;
for j2=1:jj
f1=w(i2,j2)-m(l2,j2)% objective function
sumz1=sumz1+f1
end
x2(i2,l2)=x(i2,l2)%subject
sumy1=sumy1+x2(i2,l2)
z1=sumz1*sumy1 % final formula for minimization of gruping problem
sumzfinal=sumzfinal+z1
end
end
Here, I'm unable to find x
where x= where, x_il =1 if ith machine is in cell l, otherwise 0 x_il is basically the arrangement of machines in cell. So, arrangement can be of different type. And I need all the possible types of arrangement.
Where, x_il= [1 0
0 1
1 0
0 1
1 0]
When, 1st , 3rd ,and 5th machine is in cell 1
And 2nd and 4th machine is in cell 2.
Using this value of x , for all x m_lj will be calculated, so that we will have the optimized value of cell load variation .
0 Comments
Answers (0)
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!