-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathFOA.m
39 lines (26 loc) · 889 Bytes
/
FOA.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function Forest = FOA(Forest, Eval)
global check;
bestTree=Forest.T(randi([1 size(Forest.T,1)]),:);
count=0;
global show;
show=zeros(Forest.P.MaxIterations,1);
for i=1:Forest.P.MaxIterations
Forest=LocalSeeding(Forest,Eval);
[Forest,candidate]=PopulationLimiting(Forest);
Forest=GlobalSeeding(candidate,Forest,Eval);
Forest=PopulationLimiting(Forest);
[Forest,bestTree]=UpdateBestTree(Forest,bestTree);
disp(['iter ' num2str(i) ': ' num2str(bestTree(end-1))]);
show(i,1)=bestTree(end-1);
% if check
% break;
% end
% if(changed==1)
% % count=count+1;
% % if(count==5)
% % break;
% % end
% break;
% end
end
end