Class SensorHelper
Utility methods related to ISensor implementations.
Inherited Members
Namespace: Unity.MLAgents.Sensors
Assembly: Unity.ML-Agents.dll
Syntax
public static class SensorHelper
Methods
CompareObservation(ISensor, float[,,], out string)
Generates the observations for the provided sensor, and returns true if they equal the expected values. If they are unequal, errorMessage is also set. This should not generally be used in production code. It is only intended for simplifying unit tests.
Declaration
public static bool CompareObservation(ISensor sensor, float[,,] expected, out string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
ISensor | sensor |
|
float[,,] | expected | The expected observations. |
string | errorMessage | The error message to throw if sensor observation doesn't match. |
Returns
Type | Description |
---|---|
bool | True if the generated observation for the provided sensor equal the expected values, False if not. |
CompareObservation(ISensor, float[], out string)
Generates the observations for the provided sensor, and returns true if they equal the expected values. If they are unequal, errorMessage is also set. This should not generally be used in production code. It is only intended for simplifying unit tests.
Declaration
public static bool CompareObservation(ISensor sensor, float[] expected, out string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
ISensor | sensor | The |
float[] | expected | The expected observations. |
string | errorMessage | The error message to throw if sensor observation doesn't match. |
Returns
Type | Description |
---|---|
bool | True if the observations for the provided sensor equal the expected values, False if not. |