pub struct TspState {
pub tour: Vec<usize>,
pub tour_length: u32,
pub best_tour: Vec<usize>,
pub best_tour_length: u32,
pub restart_count: u32,
pub two_opt_count: u64,
pub step_count: u64,
pub is_converged: bool,
}Expand description
TSP state snapshot.
This is THE state that gets compared for TUI/WASM parity.
It MUST be PartialEq for the probar tests.
Fields§
§tour: Vec<usize>Current tour (city indices).
tour_length: u32Current tour length.
best_tour: Vec<usize>Best tour found.
best_tour_length: u32Best tour length.
restart_count: u32Number of restarts completed.
two_opt_count: u64Total 2-opt improvements made.
step_count: u64Step count.
is_converged: boolIs converged (no improvement in N restarts).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TspState
impl<'de> Deserialize<'de> for TspState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TspState
impl StructuralPartialEq for TspState
Auto Trait Implementations§
impl Freeze for TspState
impl RefUnwindSafe for TspState
impl Send for TspState
impl Sync for TspState
impl Unpin for TspState
impl UnsafeUnpin for TspState
impl UnwindSafe for TspState
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.