Struct radiate_rust::engines::codex::Codex
source · pub struct Codex<G, A, T>where
G: Gene<G, A>,{
pub encoder: Option<Box<dyn Fn() -> Genotype<G, A>>>,
pub decoder: Option<fn(_: &Genotype<G, A>) -> T>,
}Fields§
§encoder: Option<Box<dyn Fn() -> Genotype<G, A>>>§decoder: Option<fn(_: &Genotype<G, A>) -> T>Implementations§
source§impl<G: Gene<G, A>, A, T> Codex<G, A, T>
impl<G: Gene<G, A>, A, T> Codex<G, A, T>
pub fn new() -> Self
pub fn encode(&self) -> Genotype<G, A>
pub fn decode(&self, genotype: &Genotype<G, A>) -> T
pub fn encoder(self, encoder: impl Fn() -> Genotype<G, A> + 'static) -> Self
pub fn decoder(self, decoder: fn(_: &Genotype<G, A>) -> T) -> Self
pub fn spawn(&self, num: i32) -> Vec<T>
pub fn spawn_genotypes(&self, num: i32) -> Vec<Genotype<G, A>>
pub fn spawn_population(&self, num: i32) -> Population<G, A>
Auto Trait Implementations§
impl<G, A, T> Freeze for Codex<G, A, T>
impl<G, A, T> !RefUnwindSafe for Codex<G, A, T>
impl<G, A, T> !Send for Codex<G, A, T>
impl<G, A, T> !Sync for Codex<G, A, T>
impl<G, A, T> Unpin for Codex<G, A, T>
impl<G, A, T> !UnwindSafe for Codex<G, A, T>
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