pub struct CycleProgress<const N: usize, const NSYMS: usize> {
pub iteration: Arc<AtomicUsize>,
pub score: Arc<AtomicIsize>,
pub violations: Arc<AtomicUsize>,
pub progress: Arc<AtomicUsize>,
pub top: Arc<RwLock<Candidate<N, NSYMS>>>,
pub sigint: Arc<AtomicBool>,
pub seed_pool_size: Arc<AtomicUsize>,
pub diversity_violations: Arc<AtomicUsize>,
}
Expand description
Communication between a [Gas.cycle] running in a thread and the main thread. This allows the GA algorithm to be monitored during execution.
Fields
iteration: Arc<AtomicUsize>
out: the number of iterations of the GA that have been run
score: Arc<AtomicIsize>
out: continually updated with a rounded integer of Candidate of the best candidate
violations: Arc<AtomicUsize>
out: continually updated with the number of constraint violations of the best candidate
progress: Arc<AtomicUsize>
out: continually updated with progress, values 0-100. Does not increment until stagnation is detected.
top: Arc<RwLock<Candidate<N, NSYMS>>>
out: copy of the top candidate
sigint: Arc<AtomicBool>
in: SIGINT or similar. if set, cycle will finish and exit ASAP
seed_pool_size: Arc<AtomicUsize>
diversity_violations: Arc<AtomicUsize>
Implementations
sourceimpl<const N: usize, const NSYMS: usize> CycleProgress<N, NSYMS>
impl<const N: usize, const NSYMS: usize> CycleProgress<N, NSYMS>
pub fn new(
gas: &Gas<N, NSYMS>,
sigint: &Arc<AtomicBool>
) -> CycleProgress<N, NSYMS>
sourcepub fn clone(&self) -> CycleProgress<N, NSYMS>
pub fn clone(&self) -> CycleProgress<N, NSYMS>
Arc::clone all the Arc’s. So like Arc::clone, doesn’t actually clone the contents of the CycleProgress, just the wrapper.
pub fn eprint(&self)
Auto Trait Implementations
impl<const N: usize, const NSYMS: usize> RefUnwindSafe for CycleProgress<N, NSYMS>
impl<const N: usize, const NSYMS: usize> Send for CycleProgress<N, NSYMS>
impl<const N: usize, const NSYMS: usize> Sync for CycleProgress<N, NSYMS>
impl<const N: usize, const NSYMS: usize> Unpin for CycleProgress<N, NSYMS>
impl<const N: usize, const NSYMS: usize> UnwindSafe for CycleProgress<N, NSYMS>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more