pub struct StrategicDatabase { /* private fields */ }Expand description
Fast strategic database for real-time pattern matching
Implementations§
Source§impl StrategicDatabase
impl StrategicDatabase
Sourcepub fn load_from_binary<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
pub fn load_from_binary<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
Load strategic database from binary file (ultra-fast)
Sourcepub fn save_to_binary<P: AsRef<Path>>(
&self,
path: P,
) -> Result<(), Box<dyn Error>>
pub fn save_to_binary<P: AsRef<Path>>( &self, path: P, ) -> Result<(), Box<dyn Error>>
Save strategic database to binary file
Sourcepub fn add_motif(&mut self, motif: StrategicMotif)
pub fn add_motif(&mut self, motif: StrategicMotif)
Add a motif to the database
Sourcepub fn find_motifs(&mut self, board: &Board) -> Vec<MotifMatch>
pub fn find_motifs(&mut self, board: &Board) -> Vec<MotifMatch>
Find strategic motifs in a position
Sourcepub fn evaluate_motifs(&self, matches: &[MotifMatch]) -> f32
pub fn evaluate_motifs(&self, matches: &[MotifMatch]) -> f32
Evaluate a collection of motif matches
Sourcepub fn get_strategic_evaluation(&mut self, board: &Board) -> f32
pub fn get_strategic_evaluation(&mut self, board: &Board) -> f32
Get strategic evaluation for a position
Sourcepub fn stats(&self) -> StrategicDatabaseStats
pub fn stats(&self) -> StrategicDatabaseStats
Get database statistics
Auto Trait Implementations§
impl Freeze for StrategicDatabase
impl RefUnwindSafe for StrategicDatabase
impl Send for StrategicDatabase
impl Sync for StrategicDatabase
impl Unpin for StrategicDatabase
impl UnwindSafe for StrategicDatabase
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