Class BufferSensorComponent
A SensorComponent that creates a BufferSensor.
Namespace: Unity.MLAgents.Sensors
Syntax
public class BufferSensorComponent : SensorComponent
Properties
MaxNumObservables
This is the maximum number of entities the BufferSensor
will be able to
collect.
Declaration
public int MaxNumObservables { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
ObservableSize
This is how many floats each entities will be represented with. This number is fixed and all entities must have the same representation.
Declaration
public int ObservableSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
SensorName
Name of the generated BufferSensor object. Note that changing this at runtime does not affect how the Agent sorts the sensors.
Declaration
public string SensorName { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
AppendObservation(Single[])
Appends an observation to the buffer. If the buffer is full (maximum number of observation is reached) the observation will be ignored. the length of the provided observation array must be equal to the observation size of the buffer sensor.
Declaration
public void AppendObservation(float[] obs)
Parameters
Type | Name | Description |
---|---|---|
Single[] | obs | The float array observation |
CreateSensors()
Create the ISensors. This is called by the Agent when it is initialized.
Declaration
public override ISensor[] CreateSensors()
Returns
Type | Description |
---|---|
ISensor[] | Created ISensor objects. |