@@ -198,14 +198,43 @@ def test_simulate_until_max_customers_with_pbar_method(self):
198198 self .assertEqual (Q3 .progress_bar .n , max_custs )
199199
200200 def test_simulate_until_deadlock_method (self ):
201+ # NaiveBlocking tracker
201202 ciw .seed (3 )
202203 Q = ciw .Simulation (ciw .create_network_from_yml (
203204 'ciw/tests/testing_parameters/params_deadlock.yml' ),
204205 deadlock_detector = ciw .deadlock .StateDigraph (),
205- tracker = ciw .trackers .NaiveTracker ())
206+ tracker = ciw .trackers .NaiveBlocking ())
206207 Q .simulate_until_deadlock ()
207208 self .assertEqual (round (Q .times_to_deadlock [((0 , 0 ), (0 , 0 ))], 8 ), 53.88526441 )
208209
210+ # SystemPopulation tracker
211+ ciw .seed (3 )
212+ Q = ciw .Simulation (ciw .create_network_from_yml (
213+ 'ciw/tests/testing_parameters/params_deadlock.yml' ),
214+ deadlock_detector = ciw .deadlock .StateDigraph (),
215+ tracker = ciw .trackers .SystemPopulation ())
216+ Q .simulate_until_deadlock ()
217+ self .assertEqual (round (Q .times_to_deadlock [0 ], 8 ), 53.88526441 )
218+
219+ # NodePopulation tracker
220+ ciw .seed (3 )
221+ Q = ciw .Simulation (ciw .create_network_from_yml (
222+ 'ciw/tests/testing_parameters/params_deadlock.yml' ),
223+ deadlock_detector = ciw .deadlock .StateDigraph (),
224+ tracker = ciw .trackers .NodePopulation ())
225+ Q .simulate_until_deadlock ()
226+ self .assertEqual (round (Q .times_to_deadlock [(0 , 0 )], 8 ), 53.88526441 )
227+
228+ # NodeClassMatrix tracker
229+ ciw .seed (3 )
230+ Q = ciw .Simulation (ciw .create_network_from_yml (
231+ 'ciw/tests/testing_parameters/params_deadlock.yml' ),
232+ deadlock_detector = ciw .deadlock .StateDigraph (),
233+ tracker = ciw .trackers .NodeClassMatrix ())
234+ Q .simulate_until_deadlock ()
235+ self .assertEqual (round (Q .times_to_deadlock [((0 ,), (0 ,))], 8 ), 53.88526441 )
236+
237+
209238 def test_detect_deadlock_method (self ):
210239 Q = ciw .Simulation (ciw .create_network_from_yml (
211240 'ciw/tests/testing_parameters/params_deadlock.yml' ),
@@ -731,7 +760,7 @@ def test_schedules_and_blockages_work_together(self):
731760 queue_capacities = [2 , 2 ]
732761 )
733762 ciw .seed (11 )
734- Q = ciw .Simulation (N , deadlock_detector = ciw .deadlock .StateDigraph (),tracker = ciw .trackers .NaiveTracker ())
763+ Q = ciw .Simulation (N , deadlock_detector = ciw .deadlock .StateDigraph (),tracker = ciw .trackers .NaiveBlocking ())
735764 Q .simulate_until_deadlock ()
736765 ttd = Q .times_to_deadlock [((0 , 0 ), (0 , 0 ))]
737766 self .assertEqual (round (ttd , 5 ), 119.65819 )
0 commit comments