pub struct GenomeExperiment {
pub traits: Vec<f64>,
pub trait_names: Vec<String>,
pub fitness_scores: HashMap<String, f64>,
pub overall_fitness: f64,
pub task_summary: String,
pub successful: bool,
pub id: Uuid,
pub timestamp: DateTime<Utc>,
}Expand description
A single genome experiment result
Records the genome traits used, the fitness scores achieved, and metadata about the experiment for later analysis.
Fields§
§traits: Vec<f64>The genome traits that were tested (copies of values, not names)
trait_names: Vec<String>Trait names for reference
fitness_scores: HashMap<String, f64>Fitness scores by metric name (e.g., “task_completion”: 0.8)
overall_fitness: f64Overall fitness (0.0-1.0) - weighted average of metrics
task_summary: StringTask description (truncated for storage efficiency)
successful: boolWhether this was a successful experiment (fitness > threshold)
id: UuidUnique identifier for this experiment
timestamp: DateTime<Utc>Timestamp when experiment was recorded
Implementations§
Source§impl GenomeExperiment
impl GenomeExperiment
Sourcepub fn new(
genome: &Genome,
fitness_scores: HashMap<String, f64>,
overall: f64,
task: &str,
) -> Self
pub fn new( genome: &Genome, fitness_scores: HashMap<String, f64>, overall: f64, task: &str, ) -> Self
Create a new genome experiment from a genome and fitness results
§Arguments
genome- The genome that was testedfitness_scores- Individual metric scoresoverall- Overall fitness score (0.0-1.0)task- Task description (will be truncated to 200 chars)
§Example
use vex_core::{Genome, GenomeExperiment};
use std::collections::HashMap;
let genome = Genome::new("Test agent");
let mut scores = HashMap::new();
scores.insert("accuracy".to_string(), 0.85);
let exp = GenomeExperiment::new(&genome, scores, 0.85, "Summarize document");
assert!(exp.successful);Trait Implementations§
Source§impl Clone for GenomeExperiment
impl Clone for GenomeExperiment
Source§fn clone(&self) -> GenomeExperiment
fn clone(&self) -> GenomeExperiment
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 GenomeExperiment
impl Debug for GenomeExperiment
Source§impl<'de> Deserialize<'de> for GenomeExperiment
impl<'de> Deserialize<'de> for GenomeExperiment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GenomeExperiment
impl RefUnwindSafe for GenomeExperiment
impl Send for GenomeExperiment
impl Sync for GenomeExperiment
impl Unpin for GenomeExperiment
impl UnwindSafe for GenomeExperiment
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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