pub struct WarmStartExactJhAgent { /* private fields */ }Expand description
Warm-start exact finite-horizon objective controller.
Implementations§
Source§impl WarmStartExactJhAgent
impl WarmStartExactJhAgent
Sourcepub fn new(
config: WarmStartExactJhConfig,
teacher: WarmStartExactJhTeacherDataset,
) -> Result<Self, WarmStartExactJhError>
pub fn new( config: WarmStartExactJhConfig, teacher: WarmStartExactJhTeacherDataset, ) -> Result<Self, WarmStartExactJhError>
Construct a new warm-start exact-J_H agent.
Sourcepub fn from_compiled_planner_run(
compiled: &CompiledPlannerRunSpec,
teacher: WarmStartExactJhTeacherDataset,
) -> Result<Self, WarmStartExactJhError>
pub fn from_compiled_planner_run( compiled: &CompiledPlannerRunSpec, teacher: WarmStartExactJhTeacherDataset, ) -> Result<Self, WarmStartExactJhError>
Construct from a compiled planner-run spec and same-task teacher data.
Sourcepub fn steps_observed(&self) -> usize
pub fn steps_observed(&self) -> usize
Number of transitions incorporated from live interaction.
Sourcepub fn teacher_label_count(&self) -> usize
pub fn teacher_label_count(&self) -> usize
Number of warm-start labels incorporated from the teacher dataset.
Sourcepub fn same_task_live_trace(&self) -> Option<WarmStartExactJhTeacherTrace>
pub fn same_task_live_trace(&self) -> Option<WarmStartExactJhTeacherTrace>
Extract the current live same-task trajectory as a teacher trace.
The trace is admissible under the same runtime validator used for
teacher datasets because it was produced through observe_transition.
Cost: despite the &self receiver this is a full materialization, not a
cheap accessor. It allocates a fresh transition vector and clones every
stored observation stream, so a call is O(steps * observation_stream_len)
in both time and allocated memory. It is intended for occasional
refresh/export points; callers in a hot loop should cache the result
rather than re-deriving it per step.
Sourcepub fn num_actions(&self) -> ActionAlphabet
pub fn num_actions(&self) -> ActionAlphabet
Configured action alphabet cardinality.
Sourcepub fn planner_simulations_per_step(&self) -> usize
pub fn planner_simulations_per_step(&self) -> usize
Canonical direct-evaluator budget marker.
This is always 1; warm-start exact-(J_H) has no simulation loop.
Sourcepub fn resolved_random_seed(&self) -> u64
pub fn resolved_random_seed(&self) -> u64
Resolved deterministic seed.
Sourcepub fn get_planned_action(&mut self) -> Action
pub fn get_planned_action(&mut self) -> Action
Select the next greedy action from the current exact-return model.
§Panics
Panics if retained live history violates the validated warm-start
runtime contract. Use Self::try_get_planned_action to receive that
condition as WarmStartExactJhError.
Sourcepub fn try_get_planned_action(
&mut self,
) -> Result<Action, WarmStartExactJhError>
pub fn try_get_planned_action( &mut self, ) -> Result<Action, WarmStartExactJhError>
Fallibly select the next greedy action from the current exact-return model.
Sourcepub fn estimate_action_values(
&mut self,
) -> Result<Vec<f64>, WarmStartExactJhError>
pub fn estimate_action_values( &mut self, ) -> Result<Vec<f64>, WarmStartExactJhError>
Estimate exact finite-horizon action values at the current decision state.
Sourcepub fn get_planned_action_with_extra_exploration(
&mut self,
extra_exploration: f64,
) -> Action
pub fn get_planned_action_with_extra_exploration( &mut self, extra_exploration: f64, ) -> Action
Select the next action with optional epsilon exploration.
Warm-start exact-(J_H) has no baseline exploration parameter; this method’s argument is the entire exploration probability.
§Panics
Panics if greedy planning is reached and retained live history violates
the validated warm-start runtime contract. Use
Self::try_get_planned_action_with_extra_exploration_flag to receive
that condition as WarmStartExactJhError.
Sourcepub fn get_planned_action_with_extra_exploration_flag(
&mut self,
extra_exploration: f64,
) -> (Action, bool)
pub fn get_planned_action_with_extra_exploration_flag( &mut self, extra_exploration: f64, ) -> (Action, bool)
Select the next action with optional epsilon exploration and return whether exploration fired.
Warm-start exact-(J_H) has no baseline exploration parameter; this method’s argument is the entire exploration probability.
§Panics
Panics if greedy planning is reached and retained live history violates
the validated warm-start runtime contract. Use
Self::try_get_planned_action_with_extra_exploration_flag to receive
that condition as WarmStartExactJhError.
Sourcepub fn try_get_planned_action_with_extra_exploration_flag(
&mut self,
extra_exploration: f64,
) -> Result<(Action, bool), WarmStartExactJhError>
pub fn try_get_planned_action_with_extra_exploration_flag( &mut self, extra_exploration: f64, ) -> Result<(Action, bool), WarmStartExactJhError>
Fallibly select the next action with optional epsilon exploration and return whether exploration fired.
Warm-start exact-(J_H) has no baseline exploration parameter; this method’s argument is the entire exploration probability.
Sourcepub fn observe_transition(
&mut self,
action: Action,
observations: &[PerceptVal],
reward: Reward,
) -> Result<(), WarmStartExactJhError>
pub fn observe_transition( &mut self, action: Action, observations: &[PerceptVal], reward: Reward, ) -> Result<(), WarmStartExactJhError>
Record one live environment transition.
Auto Trait Implementations§
impl Freeze for WarmStartExactJhAgent
impl !RefUnwindSafe for WarmStartExactJhAgent
impl Send for WarmStartExactJhAgent
impl !Sync for WarmStartExactJhAgent
impl Unpin for WarmStartExactJhAgent
impl UnsafeUnpin for WarmStartExactJhAgent
impl !UnwindSafe for WarmStartExactJhAgent
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.