浏览代码

Replace AddVectorObs(float[]) and AddVectorObs(List<float>) with a more generic AddVectorObs(IEnumerable<float>) (#1540)

/develop-generalizationTraining-TrainerController
Arthur Juliani 6 年前
当前提交
9d2a8c53
共有 1 个文件被更改,包括 3 次插入13 次删除
  1. 16
      UnitySDK/Assets/ML-Agents/Scripts/Agent.cs

16
UnitySDK/Assets/ML-Agents/Scripts/Agent.cs


}
/// <summary>
/// Adds a float array observation to the vector observations of the agent.
/// Increases the size of the agents vector observation by size of array.
/// </summary>
/// <param name="observation">Observation.</param>
protected void AddVectorObs(float[] observation)
{
info.vectorObservation.AddRange(observation);
}
/// <summary>
/// Adds a float list observation to the vector observations of the agent.
/// Increases the size of the agents vector observation by size of list.
/// Adds a collection of float observations to the vector observations of the agent.
/// Increases the size of the agents vector observation by size of the collection.
protected void AddVectorObs(List<float> observation)
protected void AddVectorObs(IEnumerable<float> observation)
{
info.vectorObservation.AddRange(observation);
}

正在加载...
取消
保存