#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum SelectionKind {
#[default]
Fifo,
Ucb1,
Greedy,
Thompson,
}
impl std::fmt::Display for SelectionKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Fifo => write!(f, "FIFO"),
Self::Ucb1 => write!(f, "UCB1"),
Self::Greedy => write!(f, "Greedy"),
Self::Thompson => write!(f, "Thompson"),
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_selection_kind_display() {
assert_eq!(SelectionKind::Fifo.to_string(), "FIFO");
assert_eq!(SelectionKind::Ucb1.to_string(), "UCB1");
assert_eq!(SelectionKind::Greedy.to_string(), "Greedy");
assert_eq!(SelectionKind::Thompson.to_string(), "Thompson");
}
#[test]
fn test_selection_kind_default() {
assert_eq!(SelectionKind::default(), SelectionKind::Fifo);
}
}