pub struct StrategyContext {
pub frontier_count: usize,
pub total_visits: u32,
pub failure_rate: f64,
pub success_rate: f64,
pub current_strategy: SelectionKind,
pub avg_depth: Option<f32>,
}Expand description
戦略判断に必要なコンテキスト
Fields§
§frontier_count: usizeフロンティア数
total_visits: u32総訪問数
failure_rate: f64失敗率 (0.0-1.0)
success_rate: f64成功率 (0.0-1.0)
current_strategy: SelectionKind現在の戦略
avg_depth: Option<f32>探索の深さ(平均)- オプション
Implementations§
Source§impl StrategyContext
impl StrategyContext
Sourcepub fn new(
frontier_count: usize,
total_visits: u32,
failure_rate: f64,
current_strategy: SelectionKind,
) -> Self
pub fn new( frontier_count: usize, total_visits: u32, failure_rate: f64, current_strategy: SelectionKind, ) -> Self
新しい StrategyContext を作成
Sourcepub fn from_provider_context(
ctx: &ProviderContext<'_, ActionNodeData, String, MapNodeState>,
current: SelectionKind,
) -> Self
pub fn from_provider_context( ctx: &ProviderContext<'_, ActionNodeData, String, MapNodeState>, current: SelectionKind, ) -> Self
SwarmStats と ProviderContext から構築
Sourcepub fn from_stats(
stats: &SwarmStats,
frontier_count: usize,
current: SelectionKind,
) -> Self
pub fn from_stats( stats: &SwarmStats, frontier_count: usize, current: SelectionKind, ) -> Self
SwarmStats から構築
Sourcepub fn with_avg_depth(self, depth: f32) -> Self
pub fn with_avg_depth(self, depth: f32) -> Self
平均深度を設定
Trait Implementations§
Source§impl Clone for StrategyContext
impl Clone for StrategyContext
Source§fn clone(&self) -> StrategyContext
fn clone(&self) -> StrategyContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StrategyContext
impl RefUnwindSafe for StrategyContext
impl Send for StrategyContext
impl Sync for StrategyContext
impl Unpin for StrategyContext
impl UnwindSafe for StrategyContext
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> 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>
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