Пример #1
0
    // Use this for initialization
    void Start()
    {
        BoardGame.setDebug(debug);
        game       = TicTacToe.Instance;
        crossAgent = new TicTacToeAgent(1);
        notAgent   = new TicTacToeAgent(-1);
        game.init(ForLearning, dim, 0, ComputerSymbol);
        brain = QLearning.Instance;
        brain.init(game, dim, epsilon, alpha, gamma);



        if (!ForLearning)
        {
            InitEventTriggers();

            //player.playTicTacToe(dim, NumEpisodes, epsilon, alpha, gamma);

            SetupTiles();

            game.StateMachine.Enable(BackgroundPlane, theTiles, notAgent, crossAgent, BrainType.Player, You);
            // FirstTime
            pubInstance.NotifyListeners("ResetGame");
        }
    }
Пример #2
0
    public override void InitializeAgent()
    {
        lastStep = -1;
        isPaused = true;
        toResume = false;
        myVal    = Symbol;

        // FirstTime
        InitEventTriggers();
        if (TicTacToe.Instance.IsLearning)
        {
            maxStepInit = maxStep;
            pubInstance.NotifyListeners("ResetGame");
        }
        else
        {
            maxStep = 0;
            Status.gameObject.SetActive(false);

            if (BoardGame.Computer == myVal)
            {
                pauseStep();
            }
        }
    }
 public override void AcademyReset()
 {
     defencePenalty = (float)resetParameters ["defence_penalty"];
     defenceReward  = (float)resetParameters ["defence_reward"];
     StopAllCoroutines();
     //Debug.Log (" Current Step " + currentStep);
     pubInstance.NotifyListeners("ResetGame");
 }
Пример #4
0
 public void NotifyListeners(string eventType, params GameObject[] participants)
 {
     pubInstance.NotifyListeners(eventType, participants);
 }