浏览代码

[Important] Fixes the logic of the academy reset (#417)

The External Communicator now sends the AcademyDone properly
/develop-generalizationTraining-TrainerController
GitHub 6 年前
当前提交
a487853d
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 8
      unity-environment/Assets/ML-Agents/Scripts/Academy.cs
  2. 2
      unity-environment/Assets/ML-Agents/Scripts/ExternalCommunicator.cs

8
unity-environment/Assets/ML-Agents/Scripts/Academy.cs


AgentAct();
if (done)
{
done = false;
maxStepReached = false;
}
stepCount += 1;
}

{
stepCount = 0;
episodeCount++;
done = false;
maxStepReached = false;
AcademyReset();
}

2
unity-environment/Assets/ML-Agents/Scripts/ExternalCommunicator.cs


}
if (triedSendState.Values.All(x => x))
{
if (hasSentState.Values.Any(x => x))
if (hasSentState.Values.Any(x => x) || academy.IsDone())
{
// if all the brains listed have sent their state
sender.Send(AppendLength(Encoding.ASCII.GetBytes("END_OF_MESSAGE:" + (academy.IsDone() ? "True" : "False"))));

正在加载...
取消
保存