pub struct Environment {
pub name: String,
pub weights: Vec<[f64; 3]>,
}Expand description
A named environment with its own fitness weights.
Fields§
§name: String§weights: Vec<[f64; 3]>Per-position weights. Length should match strategy vector length. For each position, weights[0] = value of 0, weights[1] = value of 1, weights[2] = value of 2.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn simple(len: usize) -> Self
pub fn simple(len: usize) -> Self
Create a simple environment where each position values 2 > 1 > 0.
Sourcepub fn diagonal(len: usize) -> Self
pub fn diagonal(len: usize) -> Self
An environment that rewards the “diagonal” pattern: position i prefers value i%3.
Sourcepub fn random_seeded(len: usize, seed: u64) -> Self
pub fn random_seeded(len: usize, seed: u64) -> Self
Random environment with given seed.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Auto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
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