def create_chaser_model(seg_map=None, locs=None, isovist=None): if locs is None: locs = [[0.100, 1 - 0.900], [0.566, 1 - 0.854], [0.761, 1 - 0.665], [0.523, 1 - 0.604], [0.241, 1 - 0.660], [0.425, 1 - 0.591], [0.303, 1 - 0.429], [0.815, 1 - 0.402], [0.675, 1 - 0.075], [0.432, 1 - 0.098]] if seg_map is None: seg_map = polygons_to_segments(load_polygons("./paths.txt")) if isovist is None: isovist = i.Isovist(load_isovist_map()) model = Chaser(isovist=isovist, locs=locs, seg_map=seg_map) return model
if __name__ == '__main__': # XXX This is testing the runner model. We can view samples from the prior # conditioned [on the variable list below] #test_chaser() # setup locs = [[0.100, 1 - 0.900], [0.566, 1 - 0.854], [0.761, 1 - 0.665], [0.523, 1 - 0.604], [0.241, 1 - 0.660], [0.425, 1 - 0.591], [0.303, 1 - 0.429], [0.815, 1 - 0.402], [0.675, 1 - 0.075], [0.432, 1 - 0.098]] seg_map = polygons_to_segments(load_polygons("./paths.txt")) isovist = i.Isovist(load_isovist_map()) polys, epolys = load_segs() # # for writing the smart preplanned runner # way_pts = [[0.100, 1-0.9], [.28,.20] , [.26, .32],[.16,.36], [.11, .057], [.179, .086], [.38, .87], [.432, 1-.098]] # way_pts = np.asarray(way_pts) # print way_pts dets = [] simulation_Q_history = [] # TODO: for x simulations runner_intercepted_cnt = 0 for x in xrange(5): sim_id = str(int(time.time())) detection, Q_history = run_simulation(sim_id, locs, seg_map, isovist, polys, epolys)