浏览代码

Update Ball3DDecision.cs (#218)

I think it is important to add a simple heuristic example to demonstrate how to implement a Decision
/tag-0.2.1
Arthur Juliani 7 年前
当前提交
779e29cc
共有 1 个文件被更改,包括 18 次插入1 次删除
  1. 19
      unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs

19
unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs


{
if (gameObject.GetComponent<Brain>().brainParameters.actionSpaceType == StateType.continuous)
{
return new float[4]{ 0f, 0f, 0f, 0.0f };
List<float> ret = new List<float>();
if (state[2] < 0 || state[5] < 0)
{
ret.Add(state[5]);
}
else
{
ret.Add(state[5]);
}
if (state[3] < 0 || state[7] < 0)
{
ret.Add(-state[7]);
}
else
{
ret.Add(-state[7]);
}
return ret.ToArray();
}
else

正在加载...
取消
保存