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

Arc::clone all the Arc’s. So like Arc::clone, doesn’t actually clone the contents of the CycleProgress, just the wrapper.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.