浏览代码

Fixed `Academy` children `Brain` gathering. (#63)

/develop-generalizationTraining-TrainerController
Arthur Juliani 7 年前
当前提交
9ff529f7
共有 1 个文件被更改,包括 15 次插入4 次删除
  1. 19
      unity-environment/Assets/ML-Agents/Scripts/Academy.cs

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


[HideInInspector]
private Brain[] brains = new Brain[0];
private List<Brain> brains = new List<Brain>();

resetParameters[kv.key] = kv.value;
}
brains = gameObject.GetComponentsInChildren<Brain>();
GetBrains(gameObject, brains);
InitializeAcademy();
foreach (Brain brain in brains)

public virtual void InitializeAcademy()
{
}

Application.targetFrameRate = inferenceConfiguration.targetFrameRate;
}
}
/// Environment specific step logic.
/**

}
private static void GetBrains(GameObject gameObject, List<Brain> brains)
{
var transform = gameObject.transform;
for (var i = 0; i < transform.childCount; i++)
{
var child = transform.GetChild(i);
var brain = child.GetComponent<Brain>();
if (brain != null)
brains.Add(brain);
}
}
}
正在加载...
取消
保存