示例#1
0
 def gen(self):
     self.env_data = M_list.read()
     if (Fixed_map and self.env_data is not False):
         self.set_by_data()
         self.read = True
     else:
         self.gen_forbidden()
         # set up map generator
         self.g = self.rand_map()
         self.gen_threaten()
         self.gen_target()
         self.rand_auto_fail()
         self.rand_thr_move()
         self.read = False
     if len(self.thr_move['to']) != self.datanum['target'][1]:
         self.rand_thr_move()
     if (print_data):
         # forvi
         print('Forbid:' + str(self.forbidden_area_vertices))
         print('threaten:' + str(self.threaten))
         print('target:' + str(self.target))
示例#2
0
 def show_traj(self):
     #read a python traj
     self.traj = M_list.read(target='traj.json')
     self.v = visualization.show_visual(self.m, self.mov)
     self.v.show_traj(self.traj)