Skip to content

Commit

Permalink
[bug fix] Fix warning using demo recorder (#5216)
Browse files Browse the repository at this point in the history
(cherry picked from commit 272899a)
  • Loading branch information
vincentpierre authored and Ervin Teng committed Apr 8, 2021
1 parent 7b800d1 commit f699d8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion com.unity.ml-agents/Runtime/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,15 @@ void NotifyAgentDone(DoneReason doneReason)
// Request the last decision with no callbacks
// We request a decision so Python knows the Agent is done immediately
m_Brain?.RequestDecision(m_Info, sensors);
ResetSensors();

// We also have to write any to any DemonstationStores so that they get the "done" flag.
foreach (var demoWriter in DemonstrationWriters)
{
demoWriter.Record(m_Info, sensors);
}

ResetSensors();

if (doneReason != DoneReason.Disabled)
{
// We don't want to update the reward stats when the Agent is disabled, because this will make
Expand Down

0 comments on commit f699d8d

Please sign in to comment.