pub struct BanditRouter { /* private fields */ }
Expand description
Multi-armed bandit router for selection strategies
Implementations§
Source§impl BanditRouter
impl BanditRouter
Sourcepub fn with_config(config: BanditConfig) -> Self
pub fn with_config(config: BanditConfig) -> Self
Create with custom configuration
Sourcepub fn route_selection(
&mut self,
context: SelectionContext,
) -> Result<RoutingDecision>
pub fn route_selection( &mut self, context: SelectionContext, ) -> Result<RoutingDecision>
Route a selection request to the best strategy
Sourcepub fn provide_feedback(&mut self, feedback: PerformanceFeedback) -> Result<()>
pub fn provide_feedback(&mut self, feedback: PerformanceFeedback) -> Result<()>
Provide feedback on strategy performance
Sourcepub fn get_statistics(&self) -> BanditStatistics
pub fn get_statistics(&self) -> BanditStatistics
Get current performance statistics
Sourcepub fn export_state(&self) -> BanditState
pub fn export_state(&self) -> BanditState
Export model state for persistence
Sourcepub fn import_state(&mut self, state: BanditState) -> Result<()>
pub fn import_state(&mut self, state: BanditState) -> Result<()>
Import model state from persistence
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BanditRouter
impl RefUnwindSafe for BanditRouter
impl Send for BanditRouter
impl Sync for BanditRouter
impl Unpin for BanditRouter
impl UnwindSafe for BanditRouter
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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