pub struct SwarmStats { /* private fields */ }Expand description
Swarm オンライン統計
ActionEvent を受け取り、Selection が参照する基本統計を提供。 UCB1/Thompson が必要とする visits/success_rate をリアルタイムに更新。
Implementations§
Source§impl SwarmStats
impl SwarmStats
pub fn new() -> Self
Sourcepub fn record(&mut self, event: &ActionEvent)
pub fn record(&mut self, event: &ActionEvent)
イベントを記録
Selection 用の統計のみ更新。
- LLM イベント、Manager イベントはスキップ
- Worker の通常アクションのみ統計に反映
Sourcepub fn get_action_stats(&self, action: &str) -> ActionStats
pub fn get_action_stats(&self, action: &str) -> ActionStats
アクションの統計を取得
Sourcepub fn get_action_target_stats(&self, action: &str, target: &str) -> ActionStats
pub fn get_action_target_stats(&self, action: &str, target: &str) -> ActionStats
アクション × ターゲットの統計を取得
Sourcepub fn global(&self) -> &GlobalStats
pub fn global(&self) -> &GlobalStats
グローバル統計を取得
Sourcepub fn total_visits(&self) -> u32
pub fn total_visits(&self) -> u32
総訪問回数
Sourcepub fn total_successes(&self) -> u32
pub fn total_successes(&self) -> u32
総成功回数
Sourcepub fn total_failures(&self) -> u32
pub fn total_failures(&self) -> u32
総失敗回数
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
全体の成功率
Sourcepub fn failure_rate(&self) -> f64
pub fn failure_rate(&self) -> f64
全体の失敗率
Sourcepub fn all_action_stats(&self) -> impl Iterator<Item = (&String, &ActionStats)>
pub fn all_action_stats(&self) -> impl Iterator<Item = (&String, &ActionStats)>
全アクションの統計一覧
Trait Implementations§
Source§impl Clone for SwarmStats
impl Clone for SwarmStats
Source§fn clone(&self) -> SwarmStats
fn clone(&self) -> SwarmStats
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 moreSource§impl Debug for SwarmStats
impl Debug for SwarmStats
Source§impl Default for SwarmStats
impl Default for SwarmStats
Source§fn default() -> SwarmStats
fn default() -> SwarmStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SwarmStats
impl RefUnwindSafe for SwarmStats
impl Send for SwarmStats
impl Sync for SwarmStats
impl Unpin for SwarmStats
impl UnwindSafe for SwarmStats
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