浏览代码

The environment can now close right after being instantiated (#4071)

/MLA-1734-demo-provider
GitHub 5 年前
当前提交
18d1d96d
共有 2 个文件被更改,包括 9 次插入7 次删除
  1. 8
      com.unity.ml-agents/Runtime/Academy.cs
  2. 8
      com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs

8
com.unity.ml-agents/Runtime/Academy.cs


port = port
}
);
Communicator.QuitCommandReceived += OnQuitCommandReceived;
Communicator.ResetCommandReceived += OnResetCommand;
}
if (Communicator != null)

"Will perform inference instead."
);
Communicator = null;
}
if (Communicator != null)
{
Communicator.QuitCommandReceived += OnQuitCommandReceived;
Communicator.ResetCommandReceived += OnResetCommand;
}
}

8
com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs


m_Client = new UnityToExternalProto.UnityToExternalProtoClient(channel);
var result = m_Client.Exchange(WrapMessage(unityOutput, 200));
unityInput = m_Client.Exchange(WrapMessage(null, 200)).UnityInput;
var inputMessage = m_Client.Exchange(WrapMessage(null, 200));
unityInput = inputMessage.UnityInput;
if (result.Header.Status != 200 || inputMessage.Header.Status != 200)
{
m_IsOpen = false;
QuitCommandReceived?.Invoke();
}
return result.UnityInput;
#else
throw new UnityAgentsException(

正在加载...
取消
保存