@@ -0,0 +1,1015 @@
+import d4rl%0Aimport gym%0Afrom d4rl.carla import data_collection_agent_lane%0Aimport numpy as np%0Aimport argparse%0A%0A%0Adef main():%0A    parser = argparse.ArgumentParser()%0A    parser.add_argument('--env_name', type=str, default='carla-lane-v0', help='Maze type. small or default')%0A    parser.add_argument('--num_episodes', type=int, default=100, help='Num samples to collect')%0A    args = parser.parse_args()%0A%0A    env = gym.make(args.env_name)%0A    env.seed(0)%0A    np.random.seed(0)%0A%0A    ravg = %5B%5D%0A    for i in range(args.num_episodes):%0A        s = env.reset()%0A        controller = data_collection_agent_lane.RoamingAgent(env)%0A        returns = 0%0A        for t in range(env._max_episode_steps):%0A            act = controller.compute_action()%0A%0A            s, rew, done, _ = env.step(act)%0A            returns += rew%0A            if done:%0A                break%0A        ravg.append(returns)%0A        print(i, returns, ' mean:', np.mean(ravg))%0A    print(args.env_name, 'returns', np.mean(ravg))%0A%0A%0Aif __name__ == %22__main__%22:%0A    main()%0A%0A

Add lane controller