浏览代码

use relative position instead of angle; need to change the comments and the documentation

/bullet-hell-barracuda-test-1.3.1
vincentpierre 3 年前
当前提交
220539e9
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 9
      Project/Assets/ML-Agents/Examples/Sorter/Scripts/SorterAgent.cs

9
Project/Assets/ML-Agents/Examples/Sorter/Scripts/SorterAgent.cs


// The first 20 are one hot encoding of the value of the tile
// The 21st is the angle of the tile on the circle wall
// The 22nd is a boolean : 1 if the tile was visited already and 0 otherwise
float[] listObservation = new float[k_HighestTileValue + 2];
float[] listObservation = new float[k_HighestTileValue + 3];
listObservation[k_HighestTileValue] = (item.transform.localRotation.eulerAngles.y / 360f);
listObservation[k_HighestTileValue + 1] = item.IsVisited ? 1.0f : 0.0f;
var tileTransform = item.transform.GetChild(1);
listObservation[k_HighestTileValue] = (tileTransform.position.x - transform.position.x) / 20f;
listObservation[k_HighestTileValue + 1] = (tileTransform.position.z - transform.position.z) / 20f;
// listObservation[k_HighestTileValue] = (item.transform.localRotation.eulerAngles.y / 360f);
listObservation[k_HighestTileValue + 2] = item.IsVisited ? 1.0f : 0.0f;
// Here, the observation for the tile is added to the BufferSensor
m_BufferSensor.AppendObservation(listObservation);

正在加载...
取消
保存