Пример #1
0
        private void EndOfEpisode()
        {
            if (_sceneIsOver)
            {
                return;
            }
            if (_qlearning.Iteration >= Terminator)
            {
                _qlearning.SaveModel();
                BenchmarkSave.WriteRunTime(_stopwatch.Elapsed.TotalSeconds);
                Debug.Log("Learning over after " + _stopwatch.Elapsed.TotalSeconds + " secounds");
                if (Benchmark)
                {
                    Debug.Log("Running Tester");

                    ModeOverride = QAIMode.Testing;
                    _qlearning.LoadModel();
                    Application.LoadLevel(Application.loadedLevel);
                }
                else
                {
                    EditorApplication.isPlaying = false;
                    EditorApplication.Beep();
                }
            }
            else
            {
                Application.LoadLevel(Application.loadedLevel);
                _qlearning.Iteration++;
            }
            _sceneIsOver = true;
        }