コード例 #1
0
    public override void AgentAction(float[] vectorAction, string textAction)
    {
        var evaluation = _nvbManager.Action(vectorAction);

        SetReward(evaluation.Item1);
        if (evaluation.Item2)
        {
            Done();
        }
    }
コード例 #2
0
    private void Evaluate(float[] actions)
    {
        float maxValue = actions.Max();
        int   maxIndex = actions.ToList().IndexOf(maxValue);

        float[] action = { maxIndex };
        var     eval   = _ball.Action(action);

        _currentReward += eval.Item1;
        if (eval.Item2)
        {
            Debug.Log("Accumulated Reward: " + _currentReward);
            _currentReward = 0;
            _ball.Reset();
        }
    }