def use_model(): cart_pole_ctrl = Controller(None, 'CartPole-v1', StateBuilderCartPole(), communicate=False) # cart_pole_ctrl = Controller(None, 'Taxi-v2', None) # cart_pole_ctrl = Controller(None, 'LunarLander-v2', state_builder=StateBuilderLunarLander(), communicate=False) learner = QLearner(cart_pole_ctrl.get_action_space(), epsilon=0.0, init_alpha=.5, gamma=.9) cart_pole_ctrl.set_learner(learner) cart_pole_ctrl.load("models/CartPole-v1-7.model") count = 0 while True: cart_pole_ctrl.run(render=True) count += 1 print("Epoch {}".format(count))
from controller.Controller import Controller from models.HashTable import HashTable from models.Scanner import Scanner from models.Specification import Specification if __name__ == '__main__': fileName = input("Insert file name: ") controller = Controller(HashTable(), Scanner(Specification()), []) controller.run(fileName) controller.saveData()