pub struct TabuSolver {
pub tenure: usize,
pub max_neighbors: usize,
pub use_aspiration: bool,
/* private fields */
}Expand description
Tabu Search solver for TSP
Fields§
§tenure: usizeTabu tenure (moves stay forbidden for this many iterations)
max_neighbors: usizeMaximum neighbors to evaluate per iteration
use_aspiration: boolUse aspiration criterion (allow tabu move if it improves best known)
Implementations§
Source§impl TabuSolver
impl TabuSolver
Sourcepub fn with_tenure(self, tenure: usize) -> Self
pub fn with_tenure(self, tenure: usize) -> Self
Set tabu tenure
Sourcepub fn with_max_neighbors(self, max_neighbors: usize) -> Self
pub fn with_max_neighbors(self, max_neighbors: usize) -> Self
Set maximum neighbors to evaluate
Sourcepub fn with_aspiration(self, use_aspiration: bool) -> Self
pub fn with_aspiration(self, use_aspiration: bool) -> Self
Enable/disable aspiration criterion
Sourcepub fn refine(
&mut self,
tour: Vec<usize>,
instance: &TspInstance,
iterations: usize,
) -> TspResult<TspSolution>
pub fn refine( &mut self, tour: Vec<usize>, instance: &TspInstance, iterations: usize, ) -> TspResult<TspSolution>
Refine an existing tour (for hybrid use)
Trait Implementations§
Source§impl Clone for TabuSolver
impl Clone for TabuSolver
Source§fn clone(&self) -> TabuSolver
fn clone(&self) -> TabuSolver
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TabuSolver
impl Debug for TabuSolver
Source§impl Default for TabuSolver
impl Default for TabuSolver
Auto Trait Implementations§
impl Freeze for TabuSolver
impl RefUnwindSafe for TabuSolver
impl Send for TabuSolver
impl Sync for TabuSolver
impl Unpin for TabuSolver
impl UnwindSafe for TabuSolver
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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