浏览代码

Adding the goal conditioning sensors with the new observation specs

/goal-conditioning/grid-world
vincentpierre 4 年前
当前提交
cd52684a
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. 17
      com.unity.ml-agents/Tests/Runtime/Sensor/RenderTextureSensorTests.cs

17
com.unity.ml-agents/Tests/Runtime/Sensor/RenderTextureSensorTests.cs


}
}
}
[Test]
public void TestObservationType()
{
var width = 24;
var height = 16;
var camera = Camera.main;
var sensor = new CameraSensor(camera, width, height, true, "TestCameraSensor", SensorCompressionType.None);
var spec = sensor.GetObservationSpec();
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.Default);
sensor = new CameraSensor(camera, width, height, true, "TestCameraSensor", SensorCompressionType.None, ObservationType.Default);
spec = sensor.GetObservationSpec();
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.Default);
sensor = new CameraSensor(camera, width, height, true, "TestCameraSensor", SensorCompressionType.None, ObservationType.Goal);
spec = sensor.GetObservationSpec();
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.Goal);
}
}
}
正在加载...
取消
保存