forked from hust-diangroup/ns3-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgym-interface-data.m
73 lines (67 loc) · 1.43 KB
/
gym-interface-data.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
% Draw figures for Gym interface benchmarking
% CPU cycles during interprocess communication
% Left: ns3-gym
% Right: ns3-ai's Gym interface
seed = [0, 1, 2, 3, 4, 5];
cpp2py_mean = [
115605 6288;
116412 7584;
116335 5645;
113930 6129;
125322 6550;
114498 6911;
];
cpp2py_stddev = [
17122.9 2392.99;
18810.3 1953.11;
18649.2 3220.74;
15256.4 2335.87;
16987.4 2499.89;
14800.4 2517.83;
];
py2cpp_mean = [
126076 7665;
126901 7599;
127789 7235;
122230 7470;
133081 7723;
126814 7810;
];
py2cpp_stddev = [
12149.7 1106.71;
12016.5 1225.58;
13374.7 1111.01;
15771.1 1025.5;
13282.7 1122.41;
11829.3 586.296;
];
% C++ to Python
figure;
h = bar(seed, cpp2py_mean);
errorbar_x = zeros(6, 2);
for i = 1 : 2
errorbar_x(:, i) = h(1, i).XEndPoints';
end
hold on;
errorbar(errorbar_x, cpp2py_mean, cpp2py_stddev, 'LineStyle', 'none');
hold off;
ylim([0, 15e4]);
legend({'ns3-gym', 'ns3-ai'});
title('C++ to Python Transmission Time');
xlabel('Test Case (seed number)');
ylabel('CPU Cycles')
% Python to C++
figure;
h = bar(seed, py2cpp_mean);
errorbar_x = zeros(6, 2);
for i = 1 : 2
errorbar_x(:, i) = h(1, i).XEndPoints';
end
hold on;
errorbar(errorbar_x, py2cpp_mean, py2cpp_stddev, 'LineStyle', 'none');
hold off;
ylim([0, 15e4]);
legend({'ns3-gym', 'ns3-ai'});
title('Python to C++ Transmission Time');
xlabel('Test Case (seed number)');
ylabel('CPU Cycles')