浏览代码

Check shape of sensors every time a decision is requested (#3220)

/asymm-envs
GitHub 5 年前
当前提交
6d107fff
共有 1 个文件被更改,包括 3 次插入6 次删除
  1. 9
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/RpcCommunicator.cs

9
UnitySDK/Assets/ML-Agents/Scripts/Grpc/RpcCommunicator.cs


/// <param name="agent">Agent info.</param>
public void PutObservations(string brainKey, AgentInfo info, List<ISensor> sensors, Action<AgentAction> action)
{
if (!m_ActionCallbacks.ContainsKey(brainKey))
int numFloatObservations = sensors.GetSensorFloatObservationSize();
if (m_VectorObservationBuffer.Length < numFloatObservations)
int numFloatObservations = sensors.GetSensorFloatObservationSize();
if (m_VectorObservationBuffer.Length < numFloatObservations)
{
m_VectorObservationBuffer = new float[numFloatObservations];
}
m_VectorObservationBuffer = new float[numFloatObservations];
}
# if DEBUG

正在加载...
取消
保存