pub struct NodeStats {
pub visits: u32,
pub successes: u32,
pub failures: u32,
pub discoveries: u32,
}Expand description
ノードの実行統計
UCB1/Thompson で使用する成功/失敗カウント。
Fields§
§visits: u32訪問回数
successes: u32成功回数
failures: u32失敗回数
discoveries: u32発見した子ノード数の合計
Implementations§
Source§impl NodeStats
impl NodeStats
pub fn new() -> Self
Sourcepub fn record_success(&mut self)
pub fn record_success(&mut self)
成功を記録
Sourcepub fn record_failure(&mut self)
pub fn record_failure(&mut self)
失敗を記録
Sourcepub fn record_discovery(&mut self, count: u32)
pub fn record_discovery(&mut self, count: u32)
発見を記録
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
成功率(訪問なしの場合は 0.5)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeStats
impl RefUnwindSafe for NodeStats
impl Send for NodeStats
impl Sync for NodeStats
impl Unpin for NodeStats
impl UnwindSafe for NodeStats
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