1- from past .builtins import xrange
2-
31import unittest
42import ciw
53from random import seed , random , choice
@@ -72,7 +70,7 @@ def test_sampling_uniform_dist_hypothesis(self, u, rm):
7270 }
7371 Q = ciw .Simulation (ciw .create_network (params ))
7472 Nu = Q .transitive_nodes [0 ]
75- for itr in xrange (10 ): # Because repition happens in the simulation
73+ for itr in range (10 ): # Because repition happens in the simulation
7674 self .assertTrue (ul <= Nu .simulation .service_times [Nu .id_number ][0 ]() <= uh )
7775 self .assertTrue (ul <= Nu .simulation .inter_arrival_times [Nu .id_number ][0 ]() <= uh )
7876
@@ -149,7 +147,7 @@ def test_sampling_deterministic_dist_hypothesis(self, d, rm):
149147 }
150148 Q = ciw .Simulation (ciw .create_network (params ))
151149 Nd = Q .transitive_nodes [0 ]
152- for itr in xrange (10 ): # Because repition happens in the simulation
150+ for itr in range (10 ): # Because repition happens in the simulation
153151 self .assertEqual (Nd .simulation .service_times [Nd .id_number ][0 ](), d )
154152 self .assertEqual (Nd .simulation .inter_arrival_times [Nd .id_number ][0 ](), d )
155153
@@ -218,7 +216,7 @@ def test_sampling_triangular_dist_hypothesis(self, t, rm):
218216 }
219217 Q = ciw .Simulation (ciw .create_network (params ))
220218 Nt = Q .transitive_nodes [0 ]
221- for itr in xrange (10 ): # Because repition happens in the simulation
219+ for itr in range (10 ): # Because repition happens in the simulation
222220 self .assertTrue (tl <= Nt .simulation .service_times [Nt .id_number ][0 ]() <= th )
223221 self .assertTrue (tl <= Nt .simulation .inter_arrival_times [Nt .id_number ][0 ]() <= th )
224222
@@ -295,7 +293,7 @@ def test_sampling_exponential_dist_hypothesis(self, e, rm):
295293 }
296294 Q = ciw .Simulation (ciw .create_network (params ))
297295 Ne = Q .transitive_nodes [0 ]
298- for itr in xrange (10 ): # Because repition happens in the simulation
296+ for itr in range (10 ): # Because repition happens in the simulation
299297 self .assertTrue (Ne .simulation .service_times [Ne .id_number ][0 ]() >= 0.0 )
300298 self .assertTrue (Ne .simulation .inter_arrival_times [Ne .id_number ][0 ]() >= 0.0 )
301299
@@ -342,7 +340,7 @@ def test_sampling_gamma_dist_hypothesis(self, ga, gb, rm):
342340 }
343341 Q = ciw .Simulation (ciw .create_network (params ))
344342 Ng = Q .transitive_nodes [0 ]
345- for itr in xrange (10 ): # Because repition happens in the simulation
343+ for itr in range (10 ): # Because repition happens in the simulation
346344 self .assertTrue (Ng .simulation .service_times [Ng .id_number ][0 ]() >= 0.0 )
347345 self .assertTrue (Ng .simulation .inter_arrival_times [Ng .id_number ][0 ]() >= 0.0 )
348346
@@ -389,7 +387,7 @@ def test_sampling_lognormal_dist_hypothesis(self, lm, lsd, rm):
389387 }
390388 Q = ciw .Simulation (ciw .create_network (params ))
391389 Nl = Q .transitive_nodes [0 ]
392- for itr in xrange (10 ): # Because repition happens in the simulation
390+ for itr in range (10 ): # Because repition happens in the simulation
393391 self .assertTrue (Nl .simulation .service_times [Nl .id_number ][0 ]() >= 0.0 )
394392 self .assertTrue (Nl .simulation .inter_arrival_times [Nl .id_number ][0 ]() >= 0.0 )
395393
@@ -436,7 +434,7 @@ def test_sampling_weibull_dist_hypothesis(self, wa, wb, rm):
436434 }
437435 Q = ciw .Simulation (ciw .create_network (params ))
438436 Nw = Q .transitive_nodes [0 ]
439- for itr in xrange (10 ): # Because repition happens in the simulation
437+ for itr in range (10 ): # Because repition happens in the simulation
440438 self .assertTrue (Nw .simulation .service_times [Nw .id_number ][0 ]() >= 0.0 )
441439 self .assertTrue (Nw .simulation .inter_arrival_times [Nw .id_number ][0 ]() >= 0.0 )
442440
@@ -488,7 +486,7 @@ def test_sampling_empirical_dist_hypothesis(self, dist, rm):
488486 }
489487 Q = ciw .Simulation (ciw .create_network (params ))
490488 Nem = Q .transitive_nodes [0 ]
491- for itr in xrange (10 ): # Because repition happens in the simulation
489+ for itr in range (10 ): # Because repition happens in the simulation
492490 self .assertTrue (Nem .simulation .service_times [
493491 Nem .id_number ][0 ]() in set ([7.0 , 7.1 , 7.2 , 7.3 , 7.7 , 7.8 ]))
494492 self .assertTrue (Nem .simulation .inter_arrival_times [
@@ -554,7 +552,7 @@ def test_sampling_custom_dist(self):
554552 def test_sampling_custom_dist_hypothesis (self , custs , rm ):
555553 cust_vals = [round (i , 10 ) for i in custs ]
556554 numprobs = len (cust_vals )
557- probs = [1.0 / numprobs for i in xrange (numprobs )]
555+ probs = [1.0 / numprobs for i in range (numprobs )]
558556 my_custom_dist = [list (i ) for i in (zip (probs , cust_vals ))]
559557 params = {
560558 'Arrival_distributions' : [['Custom' , my_custom_dist ]],
@@ -564,7 +562,7 @@ def test_sampling_custom_dist_hypothesis(self, custs, rm):
564562 }
565563 Q = ciw .Simulation (ciw .create_network (params ))
566564 Nc = Q .transitive_nodes [0 ]
567- for itr in xrange (10 ): # Because repition happens in the simulation
565+ for itr in range (10 ): # Because repition happens in the simulation
568566 self .assertTrue (Nc .simulation .service_times [
569567 Nc .id_number ][0 ]() in set (cust_vals ))
570568 self .assertTrue (Nc .simulation .inter_arrival_times [
@@ -678,7 +676,7 @@ def test_sampling_function_dist_hypothesis(self, const, dist, rm):
678676 N1 = Q .transitive_nodes [0 ]
679677 N2 = Q .transitive_nodes [1 ]
680678 set_seed (5 )
681- for itr in xrange (10 ): # Because repition happens in the simulation
679+ for itr in range (10 ): # Because repition happens in the simulation
682680 self .assertTrue (N1 .simulation .inter_arrival_times [N1 .id_number ][0 ]()
683681 in set (my_empirical_dist ))
684682 self .assertTrue (N2 .simulation .inter_arrival_times [N2 .id_number ][0 ]() == const )
0 commit comments