|
|
|
|
|
|
public void TestBufferSensor() |
|
|
|
{ |
|
|
|
|
|
|
|
var bufferSensor = new BufferSensor(20, 4); |
|
|
|
var bufferSensor = new BufferSensor(20, 4, "testName"); |
|
|
|
var shape = bufferSensor.GetObservationShape(); |
|
|
|
var dimProp = bufferSensor.GetDimensionProperties(); |
|
|
|
Assert.AreEqual(shape[0], 20); |
|
|
|
|
|
|
var bufferComponent = agentGameObj.AddComponent<BufferSensorComponent>(); |
|
|
|
bufferComponent.MaxNumObservables = 20; |
|
|
|
bufferComponent.ObservableSize = 4; |
|
|
|
bufferComponent.SensorName = "TestName"; |
|
|
|
|
|
|
|
var sensor = bufferComponent.CreateSensor(); |
|
|
|
var shape = bufferComponent.GetObservationShape(); |
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual(shape, obs.Shape); |
|
|
|
Assert.AreEqual(obs.DimensionProperties.Count, 2); |
|
|
|
|
|
|
|
Assert.AreEqual(sensor.GetName(), "TestName"); |
|
|
|
|
|
|
|
for (int i = 0; i < 8; i++) |
|
|
|
{ |
|
|
|