pub struct Experience {
pub agent_id: AgentId,
pub observation: Vec<f32>,
pub action: Vec<i64>,
pub reward: f32,
pub next_observation: Vec<f32>,
pub terminated: bool,
pub truncated: bool,
pub value: f32,
pub log_prob: f32,
}Expand description
Experience tuple sent from a simulator to a learner.
All tensor payloads from the pre-Burn (tch-coupled) implementation are
replaced with plain Vec<f32> host buffers. Construct Burn tensors at
the learner-side rollout buffer with Tensor::from_floats(...) once
the buffer is full.
Fields§
§agent_id: AgentIdAgent that generated this experience.
observation: Vec<f32>Observation vector [obs_dim].
action: Vec<i64>Action taken. Length 1 for scalar discrete; num_dims for
multi-discrete (matches
crate::multi_agent::environment::MultiAgentEnvironment::agent_action_space).
reward: f32Reward received.
next_observation: Vec<f32>Next observation vector [obs_dim].
terminated: boolWhether episode terminated (natural episode end).
truncated: boolWhether episode was truncated (time limit / external reset).
value: f32Value estimate at this state (from the rollout-time policy).
log_prob: f32Log probability of the action taken under the rollout-time policy.
Implementations§
Trait Implementations§
Source§impl Clone for Experience
impl Clone for Experience
Source§fn clone(&self) -> Experience
fn clone(&self) -> Experience
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Experience
impl RefUnwindSafe for Experience
impl Send for Experience
impl Sync for Experience
impl Unpin for Experience
impl UnsafeUnpin for Experience
impl UnwindSafe for Experience
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more