pub struct Trace {
pub agent_id: String,
pub actions: Vec<Action>,
pub start_time: f64,
pub end_time: f64,
}Expand description
A trace of an agent’s behavior over time.
Fields§
§agent_id: String§actions: Vec<Action>§start_time: f64§end_time: f64Implementations§
Source§impl Trace
impl Trace
pub fn new(agent_id: &str) -> Self
pub fn record(&mut self, action: Action)
pub fn duration(&self) -> f64
pub fn action_count(&self) -> usize
pub fn success_rate(&self) -> f64
pub fn action_types(&self) -> HashMap<String, usize>
pub fn filter_by_type(&self, action_type: &str) -> Vec<&Action>
pub fn avg_duration(&self) -> f64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trace
impl RefUnwindSafe for Trace
impl Send for Trace
impl Sync for Trace
impl Unpin for Trace
impl UnsafeUnpin for Trace
impl UnwindSafe for Trace
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