Table 1: Parameters used for the RL algorithm.
Parameter s
max
α γ ε
Value 100,000 0.1 1 1
Table 2: The TC1 results using the RL approach in each
execution.
Ex.
C++ Matlab
Error t [ms] Error t [ms]
1 10.44 32,404 10.44 117,253
2 10.44 32,515 10.44 117,252
3 10.44 32,761 10.44 117,106
4 10.44 32,961 10.44 119,307
5 10.44 33,357 10.44 119,113
6 10.44 34,818 10.44 117,690
7 10.44 35,409 10.44 118,236
8 10.44 34,544 10.44 118,427
9 10.44 35,130 10.44 118,242
10 10.44 36,324 10.82 117,918
82,494
82,492
82,486
82,491
82,498 82,498
MUX
1
MUX
2
MUX
3
MUX
4
MUX
5
MUX
6
0
10,000
20,000
30,000
40,000
50,000
60,000
70,000
80,000
90,000
Flow [B]
Port 15
Port 14
Port 13
Port 12
Port 11
Port 10
Port 9
Port 8
Port 7
Port 6
Port 5
Port 4
Port 3
Port 2
Port 1
Figure 2: The same best TC1 flow allocation based on RL
produced in C++ (Execution 1) and Matlab (Execution 3).
Table 3: Comparison of LB solution methods based on the
best flow allocation for the TC1.
Met.
C++ Matlab
Error t [ms] Error t [ms]
GH 243.89 47 243.89 1
ILP 21.19 17,127 23.81 1,465
RL 10.44 32,404 10.44 117,106
The error is equal approximately to 10.44 giving a so-
lution close to the global optimum in each execution.
In Figure 2, the same best TC1 flow allocation pro-
duced in C++ (Execution 1) and Matlab (Execution
3) is shown. Moreover, a comparison of the lowest
total flow allocation and highest total flow allocation
for the respective MUXes might be performed. The
third MUX has the lowest total flow allocation with
value of 82,486 B and on the other hand, the fifth and
Table 4: The TC2 results using the RL approach in each
execution.
Ex.
C++ Matlab
Error t [ms] Error t [ms]
1 11.23 59,566 11.66 206,358
2 7.07 61,716 5.29 203,017
3 11.66 63,979 6.48 203,287
4 11.31 66,219 11.22 204,427
5 11.31 74,745 6.32 207,476
6 6.48 77,605 11.22 208,410
7 7.87 79,134 2.45 204,824
8 11.66 80,781 6.16 205,160
9 2.83 75,882 11.49 204,299
10 11.23 76,138 11.14 204,525
sixth MUX have the highest total flow allocation with
a value of 82,498 B each. The ratio of the flows is
82,486/82,498 ≈ 99.99%.
In order to calculate an optimal solution, Matlab
consumes several times more computational time than
a version implemented in C++. The high computa-
tional time for Matlab comes from a type of opera-
tion required in an optimization process. In RL, the
main mathematical operations are performed on sub-
matices of matrices, e.g., sum of elements, minimum
or maximum from elements of a submatrix. In C++,
pointers are a very efficient way how to implement
such mathematical operations. Since pointers are ab-
sent in Matlab, a submatrix must be always copied to
perform a particular mathematical operation.
However, the computational time for both C++
and Matlab is quite high, resulting in an exclusion of
the RL algorithm as a real-time LB solver. On the
other hand, the error is quite small. Therefore, the RL
approach can be considered for a long-term LB setup,
where no frequent changes in the flows are expected.
The proposed RL algorithm is compared with
other LB solution methods – Greedy Heuristic (GH)
and Integer Linear Programming (ILP) – in Table 3.
4.2 Test Case 2
The Test Case 2 (TC2) consists of m = 8 MUXes with
p = 15 ingoing ports each and thus, it corresponds
to the iFDAQ full setup. However, the iFDAQ full
setup has never been in operation for the COMPASS
experiment since it was not required by any physics
program. It considers n = m · p = 8 · 15 = 120 flows
with values randomly generated in the range from 0 B
to 10 kB. The parameters used for the RL algorithm
to solve the TC2 are the same as for TC1, see Table 1.
In Table 4, the results produced in C++ and Mat-
lab for the TC2 using RL in each execution are stated.
ICAART 2020 - 12th International Conference on Agents and Artificial Intelligence
740