Struct rlifesrc_lib::search::backjump::Backjump
source · pub struct Backjump<R: Rule> {
level: u32,
front: Vec<CellRef<R>>,
learnt: Vec<CellRef<R>>,
}
Expand description
(Experimental) Adding Backjumping to the original lifesrc algorithm.
Backjumping will reduce the number of steps, but each step will takes a much longer time. The current implementation is slower for most search, only useful for large (e.g., 64x64) still lifes.
Currently it is only supported for non-Generations rules.
Fields§
§level: u32
The global decision level for assigning the cell state.
front: Vec<CellRef<R>>
All cells in the front.
learnt: Vec<CellRef<R>>
A learnt clause.
Trait Implementations§
source§impl<R: Rule<IsGen = False>> Algorithm<R> for Backjump<R>
impl<R: Rule<IsGen = False>> Algorithm<R> for Backjump<R>
§type ConflReason = ConflReason<R>
type ConflReason = ConflReason<R>
Reasons for a conflict. Ignored in
LifeSrc
algorithm.source§fn confl_from_cell(cell: CellRef<R>) -> Self::ConflReason
fn confl_from_cell(cell: CellRef<R>) -> Self::ConflReason
Conflict when constitifying a cell.
source§fn confl_from_sym(cell: CellRef<R>, sym: CellRef<R>) -> Self::ConflReason
fn confl_from_sym(cell: CellRef<R>, sym: CellRef<R>) -> Self::ConflReason
Conflict from symmetry.
source§fn init_front(world: World<R, Self>) -> World<R, Self>
fn init_front(world: World<R, Self>) -> World<R, Self>
Conflict when constitifying a cell.
source§fn set_cell(
world: &mut World<R, Self>,
cell: CellRef<R>,
state: State,
reason: Self::Reason
) -> Result<(), Self::ConflReason>
fn set_cell( world: &mut World<R, Self>, cell: CellRef<R>, state: State, reason: Self::Reason ) -> Result<(), Self::ConflReason>
source§fn go(world: &mut World<R, Self>, step: &mut u64) -> bool
fn go(world: &mut World<R, Self>, step: &mut u64) -> bool
Keeps proceeding and backtracking,
until there are no more cells to examine (and returns
true
),
or the backtracking goes back to the time before the first cell is set
(and returns false
). Read moresource§impl<R: PartialEq + Rule> PartialEq for Backjump<R>
impl<R: PartialEq + Rule> PartialEq for Backjump<R>
impl<R: Eq + Rule> Eq for Backjump<R>
impl<R: Rule> Sealed for Backjump<R>
impl<R: Rule> StructuralEq for Backjump<R>
impl<R: Rule> StructuralPartialEq for Backjump<R>
Auto Trait Implementations§
impl<R> !RefUnwindSafe for Backjump<R>
impl<R> !Send for Backjump<R>
impl<R> !Sync for Backjump<R>
impl<R> Unpin for Backjump<R>
impl<R> !UnwindSafe for Backjump<R>
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