Пример #1
0
 def test_naive_change_state_block_method(self):
     Q = ciw.Simulation(ciw.create_network_from_yml(
       'ciw/tests/testing_parameters/params.yml'))
     B = ciw.NaiveTracker(Q)
     B.state = [[1, 0], [0, 0], [0, 0], [0, 0]]
     B.change_state_block(1, 1, 2)
     self.assertEqual(B.state, [[0, 1], [0, 0], [0, 0], [0, 0]])
Пример #2
0
 def test_naive_init_method(self):
     Q = ciw.Simulation(
         ciw.load_parameters(
             'ciw/tests/datafortesting/logs_test_for_simulation/parameters.yml'
         ))
     B = ciw.NaiveTracker(Q)
     self.assertEqual(B.simulation, Q)
     self.assertEqual(B.state, [[0, 0], [0, 0], [0, 0], [0, 0]])
Пример #3
0
 def test_naive_hash_state_method(self):
     Q = ciw.Simulation(
         ciw.load_parameters(
             'ciw/tests/datafortesting/logs_test_for_simulation/parameters.yml'
         ))
     B = ciw.NaiveTracker(Q)
     B.state = [[3, 4], [1, 2], [0, 1], [0, 0]]
     self.assertEqual(B.hash_state(), ((3, 4), (1, 2), (0, 1), (0, 0)))
Пример #4
0
 def test_naive_change_state_block_method(self):
     Q = ciw.Simulation(
         ciw.load_parameters(
             'ciw/tests/datafortesting/logs_test_for_simulation/parameters.yml'
         ))
     B = ciw.NaiveTracker(Q)
     B.state = [[1, 0], [0, 0], [0, 0], [0, 0]]
     B.change_state_block(1, 1, 2)
     self.assertEqual(B.state, [[0, 1], [0, 0], [0, 0], [0, 0]])
Пример #5
0
 def test_naive_change_state_release_method(self):
     Q = ciw.Simulation(ciw.create_network_from_yml(
       'ciw/tests/testing_parameters/params.yml'))
     B = ciw.NaiveTracker(Q)
     B.state = [[2, 1], [3, 0], [1, 0], [4, 4]]
     B.change_state_release(1, 1, 2, False)
     self.assertEqual(B.state, [[1, 1], [3, 0], [1, 0], [4, 4]])
     B.change_state_release(1, 1, 2, True)
     self.assertEqual(B.state, [[1, 0], [3, 0], [1, 0], [4, 4]])
Пример #6
0
 def test_naive_change_state_release_method(self):
     Q = ciw.Simulation(
         ciw.load_parameters(
             'ciw/tests/datafortesting/logs_test_for_simulation/parameters.yml'
         ))
     B = ciw.NaiveTracker(Q)
     B.state = [[2, 1], [3, 0], [1, 0], [4, 4]]
     B.change_state_release(1, 1, 2, False)
     self.assertEqual(B.state, [[1, 1], [3, 0], [1, 0], [4, 4]])
     B.change_state_release(1, 1, 2, True)
     self.assertEqual(B.state, [[1, 0], [3, 0], [1, 0], [4, 4]])
Пример #7
0
 def test_naive_init_method(self):
     Q = ciw.Simulation(ciw.create_network_from_yml(
       'ciw/tests/testing_parameters/params.yml'))
     B = ciw.NaiveTracker(Q)
     self.assertEqual(B.simulation, Q)
     self.assertEqual(B.state, [[0, 0], [0, 0], [0, 0], [0, 0]])
Пример #8
0
 def test_naive_hash_state_method(self):
     Q = ciw.Simulation(ciw.create_network_from_yml(
       'ciw/tests/testing_parameters/params.yml'))
     B = ciw.NaiveTracker(Q)
     B.state = [[3, 4], [1, 2], [0, 1], [0, 0]]
     self.assertEqual(B.hash_state(), ((3, 4), (1, 2), (0, 1), (0, 0)))