pub enum AnytimeStatus<Q> {
Improved(Q),
Converged(Q),
Aborted,
}Expand description
Returned by CuAnytimeTask::base and CuAnytimeTask::refine; drives the
runtime’s refinement scheduling.
Q is CuAnytimeTask::Quality: Quality for tasks that can score their
result, () for tasks that cannot.
After any Ok return, the output must be valid and hold the best result produced
so far for the current job: a quantum that regresses or plateaus keeps its
candidate in task-local state and leaves the output untouched. The runtime never
buffers or rolls back the output, so it can publish it at any stop point, and the
published quality is monotone even when the algorithm internally is not.
Variants§
Improved(Q)
The output holds the best result so far; further refinement may help.
Converged(Q)
Proactive yield: no further improvement is possible for this job. The output holds the final result, published unless the quality floor rejects it.
Aborted
Proactive give-up: the algorithm diverged or reached an unrecoverable state for this job. Refinement stops; the output is published as-is — subject to the quality floor once a quality has been reported — so a task that can no longer vouch even for its base result must clear the payload before returning this. The next copperlist starts a fresh job.
Trait Implementations§
Source§impl<Q: Clone> Clone for AnytimeStatus<Q>
impl<Q: Clone> Clone for AnytimeStatus<Q>
Source§fn clone(&self) -> AnytimeStatus<Q>
fn clone(&self) -> AnytimeStatus<Q>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<Q: Copy> Copy for AnytimeStatus<Q>
Source§impl<Q: Debug> Debug for AnytimeStatus<Q>
impl<Q: Debug> Debug for AnytimeStatus<Q>
Source§impl<Q: PartialEq> PartialEq for AnytimeStatus<Q>
impl<Q: PartialEq> PartialEq for AnytimeStatus<Q>
impl<Q: PartialEq> StructuralPartialEq for AnytimeStatus<Q>
Auto Trait Implementations§
impl<Q> Freeze for AnytimeStatus<Q>where
Q: Freeze,
impl<Q> RefUnwindSafe for AnytimeStatus<Q>where
Q: RefUnwindSafe,
impl<Q> Send for AnytimeStatus<Q>where
Q: Send,
impl<Q> Sync for AnytimeStatus<Q>where
Q: Sync,
impl<Q> Unpin for AnytimeStatus<Q>where
Q: Unpin,
impl<Q> UnsafeUnpin for AnytimeStatus<Q>where
Q: UnsafeUnpin,
impl<Q> UnwindSafe for AnytimeStatus<Q>where
Q: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> GetTypeRegistration for T
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> ⓘ
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> ⓘ
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