www.pudn.com > anttsp.rar > clear_fisttour.m, change:2008-04-20,size:315b


function ant=clear_fisttour(ant_num,city_num) 
%清空蚂蚁访问记录并随机初始化起点城市 
for i=1:ant_num                                    
    ant(i).visited=zeros(1,city_num); 
end 
for i=1:ant_num                                    
    ant(i).tour(1)=unidrnd(city_num); 
    ant(i).visited(ant(i).tour(1))=1; 
end