-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_lab.m
56 lines (52 loc) · 1.64 KB
/
run_lab.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function run_lab(cfg, mode)
tic
clearvars -except cfg mode
close all
clc
SetCurrentFile;
dbstop if error
paths = ["./model", "./lib", "./aoi_lab", "./config"];
addpath(genpath(paths(2)));
path_util().add_paths(paths);
disp('=============== AoI Lab ===============');
check_lab
switch nargin
case 0
save_ = false;
i = randperm(4, 1);
switch i
case 1
disp('Execute by default: config_benchmark_tsc');
run_sim(@config_benchmark_tsc, save_);
case 2
disp('Execute by default: config_benchmark_ter');
run_sim(@config_benchmark_ter, save_);
case 3
disp('Execute by default: config_benchmark_pn');
run_sim(@config_benchmark_pn, save_);
case 4
disp('Execute by default: config_benchmark_lbd')
run_sim(@config_benchmark_lbd, save_);
end
case 1
if string(cfg) == "zip_lab"
zip_lab
return
elseif string(cfg) == "zip_data"
zip_data
return
end
save_ = true;
run_sim(eval(['@', cfg]), save_);
case 2
mode = string(mode);
if mode == "test"
save_ = false;
else
save_ = true;
end
run_sim(eval(['@', cfg]), save_);
end
path_util().rm_paths(paths);
toc
end