-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbatchSimulationAll.m
38 lines (33 loc) · 943 Bytes
/
batchSimulationAll.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
clear
close all
disp('Running Batch Simulation for ALL')
start = tic;
algoList = ["PSO","NPSO","FFPSO"];
num = 500;
simulations(1,num) = Environment();
filenames = ["" "" ""];
for i = 1:length(algoList)
algo = algoList(i);
parfor j = 1:num
tic
simulation = Environment();
simulation.initialise
simulation.algoType = algo;
simulation.withPlot = false;
simulation.beginSimulation
simulation.timeTaken = toc;
simulations(j) = simulation
end
if ~exist('rawdata','dir')
mkdir rawdata
end
filename = strcat(algo, '-', string(datetime('now','Format','ddHHmmss')));
path = strcat('rawdata/',filename,'.mat');
save(path, 'simulations')
Analysis.processData(filename);
filenames(i) = filename;
end
Analysis.analyseData(filenames,true);
stop = toc(start);
disp('Batch Simulation Ended')
disp(strcat('Time taken: ', string(stop)))