pub struct SearchResult {
pub tree: SearchTree,
pub iterations: u64,
pub terminated: Option<String>,
}Expand description
the result of running a super::SearchAlgorithm.
Fields§
§tree: SearchTreethe tree created by the search algorithm
iterations: u64number of iterations run to create this tree
terminated: Option<String>if present, a message explaining a forced termination of the search. if not present, the search terminated naturally by reaching an empty frontier state.
Implementations§
Source§impl SearchResult
impl SearchResult
Sourcepub fn completed(tree: SearchTree, iterations: u64) -> SearchResult
pub fn completed(tree: SearchTree, iterations: u64) -> SearchResult
create a SearchResult for a search that completed, aka, which reached
an empty frontier state.
Sourcepub fn terminated(
tree: SearchTree,
iterations: u64,
explanation: String,
) -> SearchResult
pub fn terminated( tree: SearchTree, iterations: u64, explanation: String, ) -> SearchResult
create a SearchResult for a search that was forced to terminate by the
crate::model::termination::TerminationModel. include a message explaining the
reason it was terminated.
Trait Implementations§
Source§impl Default for SearchResult
impl Default for SearchResult
Source§fn default() -> SearchResult
fn default() -> SearchResult
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SearchResult
impl RefUnwindSafe for SearchResult
impl Send for SearchResult
impl Sync for SearchResult
impl Unpin for SearchResult
impl UnsafeUnpin for SearchResult
impl UnwindSafe for SearchResult
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> 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