浏览代码

[AcademyFirstReset] Changed the first reset logic of the academy to be consistent between training and inference (#369)

/develop-generalizationTraining-TrainerController
GitHub 7 年前
当前提交
704aab24
共有 1 个文件被更改,包括 20 次插入8 次删除
  1. 28
      unity-environment/Assets/ML-Agents/Scripts/Academy.cs

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


* use by the Academy. */
public Communicator communicator;
private bool firstAcademyReset;
void Awake()
{

AgentAct += () => { };
AgentForceReset += () => { };
if (communicator == null)
{
_AcademyReset();
AgentForceReset();
}
}

return done;
}
/// <summary>
/// Forceds the full reset. The done flags are not affected. Is either
/// called the first reset at inference and every external reset
/// at training.
/// </summary>
private void ForcedFullReset()
{
_AcademyReset();
AgentForceReset();
firstAcademyReset = true;
}
if (isInference != _isCurrentlyInference)
{

{
resetParameters[kv.Key] = kv.Value;
}
_AcademyReset();
AgentForceReset();
ForcedFullReset();
communicator.SetCommand(ExternalCommand.STEP);
}
if (communicator.GetCommand() == ExternalCommand.QUIT)

}
else if (!firstAcademyReset)
{
ForcedFullReset();
}
if ((stepsSinceReset >= maxSteps) && maxSteps > 0)

正在加载...
取消
保存