public SolverManager() { FG = 0; _timestamp = DateTime.Now.ToFileTime(); _logger = new Logger(); #if !DEBUG _logger.Init(".\\app_" + _timestamp + ".log"); #endif _logger.Log(JsonConvert.SerializeObject(SolverConfig.GetInstance())); int asyncLearners = SolverConfig.GetInstance().async_learners; _actorMonitor = new Dictionary <int, int>(); _inputInterface = new InputInterface(); _encoder = new StateEncoder(_inputInterface); _agent = new AsyncQN(asyncLearners); _learners = new AsyncSolver[asyncLearners]; for (int i = 0; i < asyncLearners; i++) { IExploration exp = null; exp = new BoltzmannExploration(SolverConfig.GetInstance().epsilon, 0.13f); exp.Init(0.13f); //exp = new EGreedyExploration(SolverConfig.GetInstance().epsilon, 0f); //exp.Init(0.05f, 0f); _learners[i] = new AsyncSolver(_inputInterface, _encoder, _agent, exp, _logger); } }
public Solver(InputInterface p_inputInterface, StateEncoder p_encoder, BaseAgent p_agent, IExploration p_exp, Logger p_logger) { _inputInterface = p_inputInterface; _encoder = p_encoder; _agent = p_agent; _exploration = p_exp; _logger = p_logger; _gameState = new StateVar(); _histogram = new Dictionary <int, int>(); }
public void Start(IExploration p_exp) { _logger = new Logger(); _timestamp = DateTime.Now.ToFileTime(); #if !DEBUG _logger.Init(".\\app_" + _timestamp + ".log"); #endif _wins = _loses = 0; _exp = p_exp; _agent = new ACN(); _firstRun = true; _environment = new FrozenLake(); Reset(); }
override public int ChooseAction(IExploration p_exp, Vector p_estimate) { _action = p_exp.ChooseAction(p_estimate); /* * BoltzmannExploration exp = (BoltzmannExploration)p_exp; * * for(int i = 0; i < 5; i++) * { * exp.Temperature = 0.5f * i + 0.15f; * exp.ChooseAction(p_estimate); * } */ return(_action); }
override public int ChooseAction(IExploration p_exp, Vector p_estimate) { _action = p_exp.ChooseAction(p_estimate); return(_action); }
public AsyncSolver(InputInterface p_inputInterface, StateEncoder p_encoder, BaseAgent p_agent, IExploration p_exp, Logger p_logger) : base(p_inputInterface, p_encoder, p_agent, p_exp, p_logger) { }
virtual public int ChooseAction(IExploration p_exp, Vector p_state0) { return(0); }