Struct ActionSegment<T>
ActionSegment{T} is a data structure that allows access to a segment of an underlying array in order to avoid the copying and allocation of sub-arrays. The segment is defined by the offset into the original array, and an length.
Inherited Members
Namespace: Unity.MLAgents.Actuators
Assembly: solution.dll
Syntax
public readonly struct ActionSegment<T> : IEnumerable<T>, IEnumerable, IEquatable<ActionSegment<T>> where T : struct
Type Parameters
| Name | Description |
|---|---|
| T | The type of object stored in the underlying Array |
Constructors
| Name | Description |
|---|---|
| ActionSegment(T[]) | Construct an ActionSegment<T> with just an actionArray. The Offset will
be set to 0 and the Length will be set to |
| ActionSegment(T[], int, int) | Construct an ActionSegment<T> with an underlying array and offset, and a length. |
Fields
| Name | Description |
|---|---|
| Empty | An Empty segment which has an offset of 0, a Length of 0, and it's underlying array is also empty. |
| Length | The number of items this segment can access in the underlying array. |
| Offset | The zero-based offset into the original array at which this segment starts. |
Properties
| Name | Description |
|---|---|
| Array | Get the underlying Array of this segment. |
| this[int] | Allows access to the underlying array using array syntax. |
Methods
| Name | Description |
|---|---|
| Clear() | Sets the segment of the backing array to all zeros. |
| Equals(object) | Indicates whether the current ActionSegment is equal to another ActionSegment. |
| Equals(ActionSegment<T>) | Indicates whether the current ActionSegment is equal to another ActionSegment. |
| GetEnumerator() | Returns an enumerator that iterates through the ActionSegment. |
| GetHashCode() | Computes the hash code of the ActionSegment. |
| IsEmpty() | Check if the segment is empty. |