Esempio n. 1
0
 def test_splitted_children(self):
     node = OccupancyOctoNode()
     node._split()
     self.assertEqual( node.probability, node.probability_at( ( 0, 0, 0 ), ( 0, 0, 0 ), 2 ) )
     self.assertEqual( node.probability, node.probability_at( ( 1, 0, 0 ), ( 0, 0, 0 ), 2 ) )
     self.assertEqual( node.probability, node.probability_at( ( 0, 1, 0 ), ( 0, 0, 0 ), 2 ) )
     self.assertEqual( node.probability, node.probability_at( ( 0, 0, 1 ), ( 0, 0, 0 ), 2 ) )
     self.assertEqual( node.probability, node.probability_at( ( 1, 1, 0 ), ( 0, 0, 0 ), 2 ) )
     self.assertEqual( node.probability, node.probability_at( ( 0, 1, 1 ), ( 0, 0, 0 ), 2 ) )
     self.assertEqual( node.probability, node.probability_at( ( 1, 0, 1 ), ( 0, 0, 0 ), 2 ) )
     self.assertEqual( node.probability, node.probability_at( ( 1, 1, 1 ), ( 0, 0, 0 ), 2 ) )
Esempio n. 2
0
 def test_unsplitted_node(self):
     node = OccupancyOctoNode()
     self.assertTrue( node.is_leaf() )
     node._split()
     self.assertFalse( node.is_leaf() )