pub struct SharedState {
pub environment: Environment,
pub stats: SwarmStats,
pub tick: u64,
pub shared_data: SharedData,
pub extensions: Extensions,
pub avg_tick_duration_ns: u64,
pub done_workers: HashSet<WorkerId>,
pub environment_done: bool,
pub llm_stats: LlmStats,
}Expand description
共有領域
Fields§
§environment: Environment環境情報
stats: SwarmStats統合統計(ActionEvent ベース)
tick: u64Tick番号
Agent間で共有するデータ(ReadOnly)
extensions: Extensions動的リソース(DB接続、HTTPクライアント等)
avg_tick_duration_ns: u64平均Tick時間(ナノ秒)- EMA で計算
done_workers: HashSet<WorkerId>Goal Action(Terminal Action)を達成した Worker
environment_done: boolEnvironment が Done(success=true) を返したかどうか
llm_stats: LlmStatsLLM 呼び出し統計
Implementations§
Sourcepub fn mark_worker_done(&mut self, worker_id: WorkerId)
pub fn mark_worker_done(&mut self, worker_id: WorkerId)
Worker を完了済みとしてマーク
Sourcepub fn is_worker_done(&self, worker_id: WorkerId) -> bool
pub fn is_worker_done(&self, worker_id: WorkerId) -> bool
Worker が完了済みかどうか
Sourcepub fn is_environment_done(&self) -> bool
pub fn is_environment_done(&self) -> bool
環境が完了したかどうか
Sourcepub fn llm_invocations(&self) -> u64
pub fn llm_invocations(&self) -> u64
LLM 呼び出し回数
Sourcepub fn llm_errors(&self) -> u64
pub fn llm_errors(&self) -> u64
LLM エラー回数
Trait Implementations§
Source§fn default() -> SharedState
fn default() -> SharedState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
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> 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