Esempio n. 1
0
 def test_parse_undefined_types(self):
     parser = PDDL_Parser()
     parser.types = {}
     parser.parse_types(['location', 'pile', 'robot', 'crane', 'container'])
     self.assertEqual(
         parser.types,
         {'object': ['location', 'pile', 'robot', 'crane', 'container']})
Esempio n. 2
0
 def test_parse_defined_types(self):
     parser = PDDL_Parser()
     parser.types = {}
     parser.parse_types([
         'place', 'locatable', 'level', '-', 'object', 'depot', 'market',
         '-', 'place', 'truck', 'goods', '-', 'locatable'
     ])
     self.assertEqual(
         parser.types, {
             'object': ['place', 'locatable', 'level'],
             'place': ['depot', 'market'],
             'locatable': ['truck', 'goods']
         })
Esempio n. 3
0
 def test_parse_objects(self):
     parser = PDDL_Parser()
     parser.types = {}
     parser.objects = {}
     parser.parse_types(
         ['airplane', 'segment', 'direction', 'airplanetype', 'a'])
     parser.parse_objects([
         'b', '-', 'a', 'a', '-', 'a', 'north', 'south', '-', 'direction',
         'light', 'medium', 'heavy', '-', 'airplanetype', 'element1', '-',
         'object', 'seg_pp_0_60', 'seg_ppdoor_0_40', '-', 'segment',
         'airplane_CFBEG', '-', 'airplane', 'element2'
     ], 'test')
     self.assertEqual(
         parser.objects, {
             'a': ['b', 'a'],
             'object': ['element1', 'element2'],
             'direction': ['north', 'south'],
             'airplanetype': ['light', 'medium', 'heavy'],
             'segment': ['seg_pp_0_60', 'seg_ppdoor_0_40'],
             'airplane': ['airplane_CFBEG']
         })