Struct ActionBuffers
A structure that wraps the Action
Inherited Members
Namespace: Unity.MLAgents.Actuators
Assembly: Unity.ML-Agents.dll
Syntax
public readonly struct ActionBuffers
Constructors
ActionBuffers(float[], int[])
Construct an Action
Declaration
public ActionBuffers(float[] continuousActions, int[] discreteActions)
Parameters
Type | Name | Description |
---|---|---|
float[] | continuousActions | The continuous actions to send to an IAction |
int[] | discreteActions | The discrete actions to send to an IAction |
ActionBuffers(ActionSegment<float>, ActionSegment<int>)
Construct an Action
Declaration
public ActionBuffers(ActionSegment<float> continuousActions, ActionSegment<int> discreteActions)
Parameters
Type | Name | Description |
---|---|---|
Action |
continuousActions | The continuous actions to send to an IAction |
Action |
discreteActions | The discrete actions to send to an IAction |
ActionBuffers(ActionSpec)
Construct an Action
Declaration
public ActionBuffers(ActionSpec actionSpec)
Parameters
Type | Name | Description |
---|---|---|
Action |
actionSpec | The Action |
Fields
Empty
An empty action buffer.
Declaration
public static ActionBuffers Empty
Field Value
Type | Description |
---|---|
Action |
Properties
ContinuousActions
Holds the Continuous Action
Declaration
public ActionSegment<float> ContinuousActions { get; }
Property Value
Type | Description |
---|---|
Action |
DiscreteActions
Holds the Discrete Action
Declaration
public ActionSegment<int> DiscreteActions { get; }
Property Value
Type | Description |
---|---|
Action |
Methods
Clear()
Clear the Continuous
Declaration
public void Clear()
Equals(object)
Indicates whether the current ActionBuffers is equal to another ActionBuffers.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | An ActionBuffers to compare with this ActionBuffers. |
Returns
Type | Description |
---|---|
bool | true if the current ActionBuffers is equal to the other parameter; otherwise, false. |
Overrides
FromDiscreteActions(float[])
Create an Action
Declaration
public static ActionBuffers FromDiscreteActions(float[] discreteActions)
Parameters
Type | Name | Description |
---|---|---|
float[] | discreteActions | The float array of discrete actions. |
Returns
Type | Description |
---|---|
Action |
An Action |
GetHashCode()
Computes the hash code of the ActionBuffers.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current ActionBuffers. |
Overrides
IsEmpty()
Check if the Action
Declaration
public bool IsEmpty()
Returns
Type | Description |
---|---|
bool | Whether the buffers are empty. |