Skip to main content

DequeSolutionSet

Struct DequeSolutionSet 

Source
pub struct DequeSolutionSet<T, Q = f64>
where T: Clone, Q: Clone,
{ /* private fields */ }
Expand description

SolutionSet implementation backed by VecDeque.

Useful when frequent pushes and pops from the front/back are expected.

Implementations§

Source§

impl<T, Q> DequeSolutionSet<T, Q>
where T: Clone, Q: Clone,

Source

pub fn new() -> Self

Source

pub fn from_deque(solutions: VecDeque<Solution<T, Q>>) -> Self

Trait Implementations§

Source§

impl<T, Q> Clone for DequeSolutionSet<T, Q>
where T: Clone + Clone, Q: Clone + Clone,

Source§

fn clone(&self) -> DequeSolutionSet<T, Q>

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<T, Q> SolutionSet<T, Q> for DequeSolutionSet<T, Q>
where T: Clone + Display, Q: Clone + Display,

Source§

fn iter(&self) -> Box<dyn Iterator<Item = &Solution<T, Q>> + '_>

Returns an iterator over all solutions in the set.
Source§

fn push_solution(&mut self, solution: Solution<T, Q>)

Appends one solution to the set.
Source§

fn pop_solution(&mut self) -> Option<Solution<T, Q>>

Removes one solution from the tail of the set semantics.
Source§

fn clear_solutions(&mut self)

Removes all solutions from the set.
Source§

fn get_solution(&self, index: usize) -> Option<&Solution<T, Q>>

Returns one solution by index when indexable.
Source§

fn get_solution_mut(&mut self, index: usize) -> Option<&mut Solution<T, Q>>

Returns one mutable solution by index when indexable.
Source§

fn len(&self) -> usize

Returns the number of solutions in the set.
Source§

fn add_solution(&mut self, solution: Solution<T, Q>)

Source§

fn remove_solution(&mut self) -> Option<Solution<T, Q>>

Remove the last solution
Source§

fn clear(&mut self)

Remove all the solutions
Source§

fn is_empty(&self) -> bool

Contains some solution
Source§

fn size(&self) -> usize

Number of solutions
Source§

fn best_solution<P>(&self, problem: &P) -> Option<&Solution<T, Q>>
where Self: Sized, P: Problem<T, Q>,

Source§

fn best_solution_value<P>(&self, problem: &P) -> Option<f64>
where Self: Sized, P: Problem<T, Q>, T: Display, Q: Copy + Into<f64>,

Source§

fn best_solution_value_or<P>(&self, problem: &P, default: f64) -> f64
where Self: Sized, P: Problem<T, Q>, T: Display, Q: Copy + Into<f64>,

Source§

fn get(&self, index: usize) -> Option<&Solution<T, Q>>

Source§

fn get_mut(&mut self, index: usize) -> Option<&mut Solution<T, Q>>

Auto Trait Implementations§

§

impl<T, Q> Freeze for DequeSolutionSet<T, Q>

§

impl<T, Q> RefUnwindSafe for DequeSolutionSet<T, Q>

§

impl<T, Q> Send for DequeSolutionSet<T, Q>
where Q: Send, T: Send,

§

impl<T, Q> Sync for DequeSolutionSet<T, Q>
where Q: Sync, T: Sync,

§

impl<T, Q> Unpin for DequeSolutionSet<T, Q>
where Q: Unpin, T: Unpin,

§

impl<T, Q> UnsafeUnpin for DequeSolutionSet<T, Q>

§

impl<T, Q> UnwindSafe for DequeSolutionSet<T, Q>
where Q: UnwindSafe, T: 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.