Esempio n. 1
0
 def __init__(self):
     self.grid_width = 0.1
     self.angle_blockwidth = np.pi / 8
     self.env = car_sim_env()
     self.state_action = []
     self.tmp_state_action = []
     self.cur_state = None
     self.cur_action = None
Esempio n. 2
0
def run(restore, LfD = False):
    env = car_sim_env()  # create environment (also adds some dummy traffic)
    agt = env.create_agent(LearningAgent, test=False)  # create agent
    env.set_agent(agt, enforce_deadline=True)  # specify agent to track


    train_thread = threading.Thread(name="train", target=train, args=(env, agt, restore, LfD))
    train_thread.daemon = True
    train_thread.start()
    env.plt_show()
    while True:
        continue
Esempio n. 3
0
def run(restore):
    env = car_sim_env()
    agt = env.create_agent(LearningAgent, test=True)
    env.set_agent(agt, enforce_deadline=False)

    train_thread = threading.Thread(name="train",
                                    target=train,
                                    args=(env, agt, restore))
    train_thread.daemon = True
    train_thread.start()
    env.plt_show()
    while True:
        continue
Esempio n. 4
0
def run(restore):
    env = car_sim_env()
    agt = LearningAgent(env, is_test=False)
    env.set_agent(agt, enforce_deadline=False)

    #train_thread = threading.Thread(name="train", target=train, args=(env, agt, restore))
    #train_thread.daemon = True # exit sub_threading when main_threading is done
    #train_thread.start()

    #plt_thread = threading.Thread(name="env.plt_show()", target=env.plt_show(), args=())
    #plt_thread.daemon = True
    #plt_thread.start()

    env.plt_show()
    train(env, agt, restore)
    while True:
        continue