pub enum EvaluationRequest<G>where
G: EvolutionaryGenome,{
RateCandidates {
candidates: Vec<Candidate<G>>,
scale: RatingScale,
},
PairwiseComparison {
candidate_a: Candidate<G>,
candidate_b: Candidate<G>,
allow_tie: bool,
},
BatchSelection {
candidates: Vec<Candidate<G>>,
select_count: usize,
min_select: usize,
},
}Expand description
Evaluation request sent to the user
Represents a request for user feedback on one or more candidates. The type of feedback requested depends on the variant.
Variants§
RateCandidates
Rate individual candidates on a numeric scale
User assigns a rating to each candidate. Ratings may be partial (not all candidates need to be rated).
PairwiseComparison
Compare two candidates - which is better?
User selects the preferred candidate, or indicates a tie (if allowed by the scale).
Fields
BatchSelection
Select N favorites from a batch
User selects their top candidates from the presented set. Selection implies preference over non-selected candidates.
Implementations§
Source§impl<G> EvaluationRequest<G>where
G: EvolutionaryGenome,
impl<G> EvaluationRequest<G>where
G: EvolutionaryGenome,
Sourcepub fn rate(candidates: Vec<Candidate<G>>) -> Self
pub fn rate(candidates: Vec<Candidate<G>>) -> Self
Create a rate candidates request with default scale
Sourcepub fn rate_with_scale(
candidates: Vec<Candidate<G>>,
scale: RatingScale,
) -> Self
pub fn rate_with_scale( candidates: Vec<Candidate<G>>, scale: RatingScale, ) -> Self
Create a rate candidates request with custom scale
Sourcepub fn select_from_batch(
candidates: Vec<Candidate<G>>,
select_count: usize,
) -> Self
pub fn select_from_batch( candidates: Vec<Candidate<G>>, select_count: usize, ) -> Self
Create a batch selection request
Sourcepub fn candidate_count(&self) -> usize
pub fn candidate_count(&self) -> usize
Get the number of candidates in this request
Sourcepub fn candidate_ids(&self) -> Vec<CandidateId>
pub fn candidate_ids(&self) -> Vec<CandidateId>
Get all candidate IDs in this request
Trait Implementations§
Source§impl<G> Clone for EvaluationRequest<G>where
G: EvolutionaryGenome + Clone,
impl<G> Clone for EvaluationRequest<G>where
G: EvolutionaryGenome + Clone,
Source§fn clone(&self) -> EvaluationRequest<G>
fn clone(&self) -> EvaluationRequest<G>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<G> Debug for EvaluationRequest<G>where
G: EvolutionaryGenome + Debug,
impl<G> Debug for EvaluationRequest<G>where
G: EvolutionaryGenome + Debug,
Source§impl<'de, G> Deserialize<'de> for EvaluationRequest<G>
impl<'de, G> Deserialize<'de> for EvaluationRequest<G>
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>,
Source§impl<G> Serialize for EvaluationRequest<G>
impl<G> Serialize for EvaluationRequest<G>
Auto Trait Implementations§
impl<G> Freeze for EvaluationRequest<G>where
G: Freeze,
impl<G> RefUnwindSafe for EvaluationRequest<G>where
G: RefUnwindSafe,
impl<G> Send for EvaluationRequest<G>
impl<G> Sync for EvaluationRequest<G>
impl<G> Unpin for EvaluationRequest<G>where
G: Unpin,
impl<G> UnsafeUnpin for EvaluationRequest<G>where
G: UnsafeUnpin,
impl<G> UnwindSafe for EvaluationRequest<G>where
G: 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,
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.