-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_testsuite.m
42 lines (33 loc) · 2.27 KB
/
run_testsuite.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
40
41
test_case_count = 36;
sample_count = 1;
for Testcase = 1:test_case_count
datestr(now)
Testcase
% create file header
value_names = {'final_boarding_time mean_boarding_time std_dev_boarding_time mean_distance std_dev_distance mean_waiting_time std_dev_waiting_time mean_decisions std_dev_decisions std_dev_boarded_per_door unboarded'};
dlmwrite(strcat('results/textfiles/', int2str(Testcase), '.txt'),strcat('Testcase Nr. ', int2str(Testcase)), 'delimiter', '');
dlmwrite(strcat('results/textfiles/', int2str(Testcase), '.txt'),value_names(1), 'delimiter', '','-append');
for isample = 1:sample_count
isample
%clear('global')
run_testcase
save(strcat('results/workspace/', int2str(Testcase), '_', int2str(isample), '.mat'));
% collect single value results
moving_agents = (agent(:,agentSTATE) ~= agentSTATEmoving)
boarding_agents = (agent(:,agentMODE) ~= agent_mode_enter_subway)
selected_agents = (boarding_agents & moving_agents)
final_boarding_time = max(stat_moving_time(selected_agents,stat_movEND))
mean_boarding_time = mean(stat_moving_time(selected_agents,stat_movEND) - stat_moving_time(selected_agents,stat_movSTART))
stddev_boarding_time = std(stat_moving_time(selected_agents,stat_movEND) - stat_moving_time(selected_agents,stat_movSTART))
mean_distance = mean(stat_sum_distance(selected_agents,1))
stddev_distance = std(stat_sum_distance(selected_agents,1))
mean_waiting_time = mean(stat_sum_waiting(selected_agents,1))
stddev_waiting_time = std(stat_sum_waiting(selected_agents,1))
mean_decision = mean(stat_sum_decision(selected_agents,1))
stddev_decision = std(stat_sum_decision(selected_agents,1))
stddev_boarded_per_door = std(stat_boarded_per_door(step,door(:,doorMODE) ~= agent_mode_enter_subway))
unboarded = sum(agent(:,agentSTATE) == agentSTATEmoving)
dlmwrite(strcat('results/textfiles/', int2str(Testcase), '.txt'), [final_boarding_time, mean_boarding_time, stddev_boarding_time, mean_distance, stddev_distance, mean_waiting_time, stddev_waiting_time, mean_decision, stddev_decision, stddev_boarded_per_door, unboarded], 'delimiter', '\t','-append');
end
end
quit