
186 Simulation Technologies in Networking and Communications
Therefore,
i
i
+
1
appends the upper ω − r bits of x
i
with lower r bits of x
i + i
. After a right
multiplication with A, the result is added with x
i + m
bit using XOR operation. Once the initial
seed (x
0
, x
2
,…, x
n−1
) is provided, the algorithm produces random integers in 0,1,…,2ω−1 [13].
Listing 2 shows a Python implementation of the Mersenne twister algorithm and is provided by
Yasar Arabac [21].
Listing 2: Implementation of Mersenne twister algorithm