From c1b26d49e4f4fc692c2688531f9e7c69dba12682 Mon Sep 17 00:00:00 2001 From: Chris Elion Date: Tue, 8 Jun 2021 13:11:23 -0700 Subject: [PATCH] cast time penalty to float (#5424) (#5426) Co-authored-by: andrewcoh <54679309+andrewcoh@users.noreply.github.com> --- .../ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs b/Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs index 0b7cd9ce8d..d76d43ef92 100644 --- a/Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs +++ b/Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs @@ -100,12 +100,12 @@ public void GoalTouched(Team scoredTeam) { if (scoredTeam == Team.Blue) { - m_BlueAgentGroup.AddGroupReward(1 - m_ResetTimer / MaxEnvironmentSteps); + m_BlueAgentGroup.AddGroupReward(1 - (float)m_ResetTimer / MaxEnvironmentSteps); m_PurpleAgentGroup.AddGroupReward(-1); } else { - m_PurpleAgentGroup.AddGroupReward(1 - m_ResetTimer / MaxEnvironmentSteps); + m_PurpleAgentGroup.AddGroupReward(1 - (float)m_ResetTimer / MaxEnvironmentSteps); m_BlueAgentGroup.AddGroupReward(-1); } m_PurpleAgentGroup.EndGroupEpisode();