示例#1
0
        private void __Run()
        {
            int EPOCHS = SolverConfig.GetInstance().epochs;

            Console.WriteLine("Level: " + SolverConfig.GetInstance().level);
            Console.WriteLine("Epochs: " + EPOCHS);

            IExploration exp = new EGreedyExploration(SolverConfig.GetInstance().epsilon, 0f);

            exp.Init(0f, 0f);
            //tester.Start(new BoltzmannExploration(2, 0, -4));

            _solver.Start(_tester);
            //BasePool.StrongControl = true;

            for (int e = 0; e < EPOCHS; e++)
            {
                while (_solver.Started)
                {
                    _solver.Update();
                }
                _solver.Reset();
                if (!_tester)
                {
                    _solver.UpdateParams(e, EPOCHS);
                }
                Console.WriteLine(exp.ToString());
                //BasePool.Instance.Check();
            }

            BasePool.Instance.Check();
            Quit();
        }
示例#2
0
        public void Run()
        {
            int EPOCHS = SolverConfig.GetInstance().epochs;

            Console.WriteLine("Epochs: " + EPOCHS);

            MazeExample tester = new MazeExample();

            //BasePool.StrongControl = true;

            IExploration exp = new EGreedyExploration(SolverConfig.GetInstance().epsilon, 0f);

            exp.Init(0.02f, 0f);
            //IExploration exp = new BoltzmannExploration(0.12f, 0.06f);
            tester.Start(exp);

            for (int e = 0; e < EPOCHS; e++)
            {
                while (tester.Started)
                {
                    tester.Update();
                }
                tester.Reset();
                tester.UpdateParams(e, EPOCHS);
                //BasePool.Instance.Check();
            }

            BasePool.Instance.Check();
            tester.Quit();
        }
示例#3
0
        public Experiment1()
        {
            SolverConfig.GetInstance().Load(@".\config.json");
            _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;

            _inputInterface = new InputInterface();
            _encoder        = new StateEncoder(_inputInterface);
            _agent          = new DDQN();
            IExploration exp = new EGreedyExploration(SolverConfig.GetInstance().epsilon, 0f);
            exp.Init(0.1f, 1f);


            _solver = new Solver(_inputInterface, _encoder, _agent, exp, _logger);
        }