Beispiel #1
0
    public void OnCommandPrompt() // should happen when it is time to make a decision
    {
        if (sendCommands)
        {
            UnitAircraft myplane = commandersToControl[0].unitsCommanded[0];
            gameState = stateSpace.GetStateIndex(myplane);

            // if exceeded time limit... then just end it
            if (isTraining && roundCountThisEpisode > maximumRoundsPerEpisode)
            {
                EndEpisode();
            }
            else
            {
                // for each agent...
                // Find state
                // Choose action
                // Queue action
                // Tell Game to submit actions
                // Use resulting state-action choice

                for (int i = 0; i < commandersToControl.Length; i++)
                {
                    SelectMove(ref commandersToControl[i], randomnessFactor, difficultyLevel);
                }
            }
        }
    }