Code covered by the BSD License

# London Kings Cross Western Concourse Genetic Algorithm

### Dean Kayton (view profile)

13 Mar 2013 (Updated )

A simple genetic algorithm is applied to a model of the London Kings Cross Western Concourse.

for popNo=1:popSize
n=nodNo(popNo,1);
m=2*n-3;
Coord=[x{popNo,1}' y{popNo,1}' z{popNo,1}'];
Con=zeros(4,2*n-3)';
for k = 2:n
Con(k-1,:) = [k-1 k 0 0];
end
for k = 2:(n+1)/2
Con(n-2+k,:) = [2*k-3 2*k-1 1 1];
end
for k = 2:(n-1)/2
Con((3*n+2*k-5)/2,:) = [2*k-2 2*k 1 1];
end

%BOUNDARY CONDITIONS
Re=zeros(n,6);
for node=[1, 2, n-1, n]
Re(node,:)=[1 1 1 1 1 1];
end
snowX=[x{popNo,1}(1);x{popNo,1}(2);x{popNo,1}(n-1);x{popNo,1}(n)];
snowY=[y{popNo,1}(1);y{popNo,1}(2);y{popNo,1}(n-1);y{popNo,1}(n)];
snowArea=polyarea(snowX,snowY);
for node=3:n-2
end
%     snowPer=zeros(m,1);
%     for k=1:m
%         snowMem(1,:)=Coord(Con(k,1),:);
%         snowMem(2,:)=Coord(Con(k,2),:);
%         snowPer(k,1)=sqrt(sum((snowMem(2,:)-snowMem(1,:)).^2));
%     end
%     snowTotPer=sum(snowPer);
w=zeros(m,3);
%SECTION PROPERTIES
E=210e9*ones(1,m);
G=80e9*ones(1,m);
for nel=1:n-1
A(:,nel)=dim_prop_chs(memSel(popNo,1),4);
Iy(:,nel)=dim_prop_chs(memSel(popNo,1),6);
Iz(:,nel)=dim_prop_chs(memSel(popNo,1),6);
J(:,nel)=dim_prop_chs(memSel(popNo,1),11);
end
for nel=n:m