浏览代码

Make the demoRecorder write the experience on reset (#3463)

* Make the demoRecorder write the experience on reset

* do nothing if demostore is null

* Calling reset data if the action is null
/release-0.14.1
Anupam Bhatnagar 5 年前
当前提交
1c924d6a
共有 2 个文件被更改,包括 10 次插入5 次删除
  1. 13
      com.unity.ml-agents/Runtime/Agent.cs
  2. 2
      com.unity.ml-agents/Runtime/DemonstrationRecorder.cs

13
com.unity.ml-agents/Runtime/Agent.cs


// We request a decision so Python knows the Agent is done immediately
m_Brain?.RequestDecision(m_Info, sensors);
if (m_Recorder != null && m_Recorder.record && Application.isEditor)
{
m_Recorder.WriteExperience(m_Info, sensors);
}
UpdateRewardStats();
// The Agent is done, so we give it a new episode Id

if ((m_RequestAction) && (m_Brain != null))
{
m_RequestAction = false;
if (m_Action.vectorActions != null)
{
AgentAction(m_Action.vectorActions);
}
AgentAction(m_Action.vectorActions);
}
}

if (m_Action.vectorActions == null){
ResetData();
}
}
}
}

2
com.unity.ml-agents/Runtime/DemonstrationRecorder.cs


/// </summary>
public void WriteExperience(AgentInfo info, List<ISensor> sensors)
{
m_DemoStore.Record(info, sensors);
m_DemoStore?.Record(info, sensors);
}
public void Close()

正在加载...
取消
保存