Solver

Struct Solver 

Source
pub struct Solver {
    pub candidate_moves: Vec<Move>,
    pub pruning_table: PruningTable,
}
Expand description

A combination of a Pruning Table and the candidate moves to solve into a specific state.

This solver packs together the relevant information that can then be passed to a search function to generate cube solutions.

§Examples

Thistlethwaite Phase 4 (All Double Moves):

use cubesim::prelude::{Cube, Move, MoveVariant::*};
use cubesim::FaceletCube;
use cubesim::PruningTable;
use cubesim::Solver;
 
let moves = vec![
    Move::U(Double), Move::D(Double), Move::F(Double),
    Move::B(Double), Move::L(Double), Move::R(Double)
];
 
let solver = Solver::new(moves.clone(), PruningTable::new(&[FaceletCube::new(3)], 6, &moves));

Fields§

§candidate_moves: Vec<Move>§pruning_table: PruningTable

Implementations§

Source§

impl Solver

Source

pub fn new(candidate_moves: Vec<Move>, pruning_table: PruningTable) -> Self

Source

pub fn is_solved(&self, cube: &impl Cube) -> bool

Source

pub fn lower_bound(&self, cube: &impl Cube) -> i32

Auto Trait Implementations§

§

impl Freeze for Solver

§

impl RefUnwindSafe for Solver

§

impl Send for Solver

§

impl Sync for Solver

§

impl Unpin for Solver

§

impl UnwindSafe for Solver

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> 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, 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.