Class ObservationWriter
Allows sensors to write to both TensorProxy and float arrays/lists.
Inherited Members
Namespace: Unity.MLAgents.Sensors
Assembly: Unity.ML-Agents.dll
Syntax
public class ObservationWriter
Constructors
ObservationWriter()
Initializes a new instance of the Observation
Declaration
public ObservationWriter()
Properties
this[int]
1D write access at a specified index. Use AddList if possible instead.
Declaration
public float this[int index] { set; }
Parameters
Type | Name | Description |
---|---|---|
int | index | Index to write to. |
Property Value
Type | Description |
---|---|
float |
this[int, int]
Write access at the specified channel and width.
Declaration
public float this[int ch, int w] { set; }
Parameters
Property Value
Type | Description |
---|---|
float |
this[int, int, int]
3D write access at the specified height, width, and channel.
Declaration
public float this[int ch, int h, int w] { set; }
Parameters
Property Value
Type | Description |
---|---|
float |
Methods
Add(Quaternion, int)
Write the Quaternion components.
Declaration
public void Add(Quaternion quat, int writeOffset = 0)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quat | The Quaternion to be written. |
int | writeOffset | Optional write offset. |
Add(Vector3, int)
Write the Vector3 components.
Declaration
public void Add(Vector3 vec, int writeOffset = 0)
Parameters
Add(Vector4, int)
Write the Vector4 components.
Declaration
public void Add(Vector4 vec, int writeOffset = 0)
Parameters
AddList(IList<float>, int)
Write the list of floats.
Declaration
public void AddList(IList<float> data, int writeOffset = 0)
Parameters
Type | Name | Description |
---|---|---|
IList<float> | data | The actual list of floats to write. |
int | writeOffset | Optional write offset to start writing from. |