% stats.m created by Toby Skinner % First written 11 August 2000 disp('Cleaning environment...'); clear all; close all; clc; %Load all the successes & alpha_beta change f1=['variables[2]']; S=load(f1); ad = 8; bd = 8; %build 3d grid chart = zeros(ad,bd); cntr = 1; for i=1:ad for j=1:bd chart(i,j)=S(cntr,length(S(1,:))); cntr = cntr+1; end end; %%%Save all useful data and load again filename=['work_space']; eval(['save ' filename ' S chart']); clear all; load work_space; %%%Display 3D graph figure colormap(cool); surf(chart); xlabel('Alpha values'); ylabel('Beta values'); zlabel('Success rate'); title('Alpha-Beta 3D plot'); %%%Display 2D grid figure; colormap(cool); surf(chart); xlabel('Alpha values (pheromone intensity)'); ylabel('Beta values (heuristic intensity)'); zlabel('Success rate (number of ants to reach goal)'); title('Alpha-Beta 2D plot'); view(0,90); %%%Display contour map figure; colormap(cool); contour(chart,16); xlabel('Alpha values (pheromone intensity)'); ylabel('Beta values (heuristic intensity)'); zlabel('Success rate (number of ants to reach goal)'); title('Alpha-Beta contour plot');