pub struct CompetitiveCoEA<B, SA, SB, F>where
B: Backend,
SA: Strategy<B, Genome = Tensor<B, 2>>,
SB: Strategy<B, Genome = Tensor<B, 2>>,
F: CoupledFitness<B>,{ /* private fields */ }Expand description
Competitive co-evolutionary algorithm over two adversarial populations.
Generic over the backend B, the two inner strategies SA/SB (each
producing Tensor<B, 2> genomes), and the CoupledFitness F that
scores them against each other. Implements
CoEvolutionaryAlgorithm so it can be driven by
CoEvolutionaryHarness.
Implementations§
Source§impl<B, SA, SB, F> CompetitiveCoEA<B, SA, SB, F>
impl<B, SA, SB, F> CompetitiveCoEA<B, SA, SB, F>
Trait Implementations§
Source§impl<B, SA, SB, F> CoEvolutionaryAlgorithm<B> for CompetitiveCoEA<B, SA, SB, F>
impl<B, SA, SB, F> CoEvolutionaryAlgorithm<B> for CompetitiveCoEA<B, SA, SB, F>
Source§type Params = CompetitiveCoEAParams<<SA as Strategy<B>>::Params, <SB as Strategy<B>>::Params>
type Params = CompetitiveCoEAParams<<SA as Strategy<B>>::Params, <SB as Strategy<B>>::Params>
Static parameters for a run (inner strategy params plus any coupling
configuration).
Source§type State = CoEAState<<SA as Strategy<B>>::State, <SB as Strategy<B>>::State>
type State = CoEAState<<SA as Strategy<B>>::State, <SB as Strategy<B>>::State>
Generation-to-generation joint state.
Source§fn init(
&self,
params: &Self::Params,
rng: &mut dyn Rng,
device: &<B as BackendTypes>::Device,
) -> Self::State
fn init( &self, params: &Self::Params, rng: &mut dyn Rng, device: &<B as BackendTypes>::Device, ) -> Self::State
Build the initial joint state (initializes both inner strategies).
Source§fn step(
&self,
params: &Self::Params,
state: Self::State,
rng: &mut dyn Rng,
device: &<B as BackendTypes>::Device,
) -> (Self::State, CoEAMetrics)
fn step( &self, params: &Self::Params, state: Self::State, rng: &mut dyn Rng, device: &<B as BackendTypes>::Device, ) -> (Self::State, CoEAMetrics)
Advance one simultaneous-update generation, returning the next state
and this generation’s
CoEAMetrics.Source§fn metrics(&self, state: &Self::State) -> CoEAMetrics
fn metrics(&self, state: &Self::State) -> CoEAMetrics
Snapshot the current metrics without advancing a generation.
Auto Trait Implementations§
impl<B, SA, SB, F> Freeze for CompetitiveCoEA<B, SA, SB, F>
impl<B, SA, SB, F> RefUnwindSafe for CompetitiveCoEA<B, SA, SB, F>
impl<B, SA, SB, F> Send for CompetitiveCoEA<B, SA, SB, F>
impl<B, SA, SB, F> Sync for CompetitiveCoEA<B, SA, SB, F>
impl<B, SA, SB, F> Unpin for CompetitiveCoEA<B, SA, SB, F>
impl<B, SA, SB, F> UnsafeUnpin for CompetitiveCoEA<B, SA, SB, F>
impl<B, SA, SB, F> UnwindSafe for CompetitiveCoEA<B, SA, SB, F>
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