浏览代码

Fixed ordering of initializing brains and academy

- Also added a return following the application quit step.
/develop-generalizationTraining-TrainerController
Marwan Mattar 7 年前
当前提交
573ab11d
共有 1 个文件被更改,包括 14 次插入11 次删除
  1. 25
      unity-environment/Assets/ML-Agents/Scripts/Academy.cs

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


/// </summary>
void InitializeEnvironment()
{
// Initialize communicator (if possible)
// Retrieve Brain and initialize Academy
List<Brain> brains = GetBrains(gameObject);
InitializeAcademy();
// Check for existence of communicator
if (communicator.CommunicatorHandShake())
{
isCommunicatorOn = true;
communicator.InitializeCommunicator();
communicator.UpdateCommand();
}
else
if (!communicator.CommunicatorHandShake())
// Initialize Academy and Brains.
InitializeAcademy();
List<Brain> brains = GetBrains(gameObject);
// Initialize Brains and communicator (if present)
}
if (communicator != null)
{
isCommunicatorOn = true;
communicator.InitializeCommunicator();
communicator.UpdateCommand();
}
// If a communicator is enabled/provided, then we assume we are in

if (communicator.GetCommand() == ExternalCommand.QUIT)
{
Application.Quit();
return;
}
}
else if (!firstAcademyReset)

正在加载...
取消
保存