Skip to main content

Archive

Struct Archive 

Source
pub struct Archive<G> { /* private fields */ }
Expand description

The MAP-Elites archive: one elite per grid cell.

Implementations§

Source§

impl<G> Archive<G>

Source

pub fn new(grid: Grid) -> Self

An empty archive over grid.

Source

pub fn grid(&self) -> &Grid

The grid.

Source

pub fn insert( &mut self, genome: G, cost: f64, descriptor: Vec<f64>, ) -> Insertion

Offers a genome; it enters if its cell is empty or holds a strictly costlier elite.

Source

pub fn get(&self, index: usize) -> Option<&Elite<G>>

The elite of cell index, if any.

Source

pub fn elites(&self) -> impl Iterator<Item = (usize, &Elite<G>)> + '_

The filled cells and their elites, in the order the cells were first filled.

Source

pub fn len(&self) -> usize

The number of filled cells.

Source

pub fn is_empty(&self) -> bool

Whether no cell is filled.

Source

pub fn coverage(&self) -> f64

The fraction of filled cells.

Source

pub fn qd_score(&self, offset: f64) -> f64

The QD-score Σ (offset - cost) over all elites; with offset at least the worst possible cost it only grows during a run.

Source

pub fn best(&self) -> Option<&Elite<G>>

The cheapest elite.

Trait Implementations§

Source§

impl<G: Clone> Clone for Archive<G>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<G: Debug> Debug for Archive<G>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<G: PartialEq> PartialEq for Archive<G>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<G: PartialEq> StructuralPartialEq for Archive<G>

Auto Trait Implementations§

§

impl<G> Forget for Archive<G>

§

impl<G> Freeze for Archive<G>
where Vec<Option<Elite<G>>>: Freeze,

§

impl<G> Move for Archive<G>

§

impl<G> RefUnwindSafe for Archive<G>

§

impl<G> Send for Archive<G>
where Vec<Option<Elite<G>>>: Send,

§

impl<G> Sync for Archive<G>
where Vec<Option<Elite<G>>>: Sync,

§

impl<G> Unpin for Archive<G>
where Vec<Option<Elite<G>>>: Unpin,

§

impl<G> UnsafeUnpin for Archive<G>

§

impl<G> UnwindSafe for Archive<G>
where Vec<Option<Elite<G>>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.