pub struct Step<O, A, F = Reward, U = O> {
    pub observation: O,
    pub action: A,
    pub feedback: F,
    pub next: Successor<O, U>,
}
Expand description

Description of an environment step.

There are a few different forms that this structure can take in terms of describing the next observation when next is Successor::Continue. These are determined by the value of the fourth generic parameter U:

  • Step<O, A, F> - U = O - The continuing successor observation is owned.
  • TransientStep<O, A, F> - U = &O - The continuing successor observation is borrowed.
  • PartialStep<O, A, F> - U = () - The continuing successor observation is omitted.

If next is Successor::Interrupt then the observation is owned in all cases.

Fields

observation: O

The initial observation.

action: A

The action taken from the initial state given the initial observation.

feedback: F

The resulting feedback.

next: Successor<O, U>

The next observation or outcome; how the episode progresses.

Implementations

Whether this step is the last of an episode.

Convert a transient step into an owned step by cloning any borrowed successor observation.

Convert a partial step into a transient step using the given reference to the next step.

Try to convert into a transient step with no successor.

Succeeds so long as self.next is not Successor::Continue.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Creates a value from an iterator. Read more

Creates a value from an iterator. Read more

Creates a value from an iterator. Read more

Creates a value from an iterator. Read more

Creates a value from an iterator. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Convert into an Any trait reference.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.