swarm_engine_core/exploration/selection/
kind.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
11pub enum SelectionKind {
12 #[default]
14 Fifo,
15 Ucb1,
17 Greedy,
19 Thompson,
21}
22
23impl std::fmt::Display for SelectionKind {
24 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25 match self {
26 Self::Fifo => write!(f, "FIFO"),
27 Self::Ucb1 => write!(f, "UCB1"),
28 Self::Greedy => write!(f, "Greedy"),
29 Self::Thompson => write!(f, "Thompson"),
30 }
31 }
32}
33
34#[cfg(test)]
35mod tests {
36 use super::*;
37
38 #[test]
39 fn test_selection_kind_display() {
40 assert_eq!(SelectionKind::Fifo.to_string(), "FIFO");
41 assert_eq!(SelectionKind::Ucb1.to_string(), "UCB1");
42 assert_eq!(SelectionKind::Greedy.to_string(), "Greedy");
43 assert_eq!(SelectionKind::Thompson.to_string(), "Thompson");
44 }
45
46 #[test]
47 fn test_selection_kind_default() {
48 assert_eq!(SelectionKind::default(), SelectionKind::Fifo);
49 }
50}