示例#1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (highestReward < robotAgent.GetCumulativeReward())
        {
            highestReward = robotAgent.GetCumulativeReward();
        }
        if (lowestReward > robotAgent.GetCumulativeReward())
        {
            lowestReward = robotAgent.GetCumulativeReward();
        }
        if (totalHighestReward < robotAgent.GetTotalReward())
        {
            totalHighestReward = robotAgent.GetTotalReward();
        }
        if (totalLowestReward > robotAgent.GetTotalReward())
        {
            totalLowestReward = robotAgent.GetTotalReward();
        }

        text.text = "Rewards:\n"
                    + robotAgent.GetReward().ToString("0.000")
                    + " (step)\n"
                    + robotAgent.GetCumulativeReward().ToString("0.00")
                    + " (episode)\n"
                    + robotAgent.GetTotalReward().ToString("0.00")
                    + " (total)\n"
                    + "\n"
                    + highestReward.ToString("0.00")
                    + " (highest) \t"
                    + totalHighestReward.ToString("0.00")
                    + " (total highest) \n"
                    + lowestReward.ToString("0.00")
                    + " (lowest) \t"
                    + totalLowestReward.ToString("0.00")
                    + " (total lowest) \n";
    }