1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Interactive Genetic Algorithm (IGA) module
//!
//! This module provides support for human-in-the-loop evolutionary optimization,
//! where fitness is derived from user preferences rather than an automated function.
//!
//! # Overview
//!
//! Interactive GAs are useful when:
//! - The fitness function cannot be easily formalized
//! - Human aesthetic judgment is needed (art, design, music generation)
//! - User preferences are subjective and vary per individual
//!
//! # Evaluation Modes
//!
//! The module supports three interaction paradigms:
//!
//! - **Rating**: Users assign numeric scores to individual candidates
//! - **Pairwise Comparison**: Users pick the better of two candidates
//! - **Batch Selection**: Users select their favorites from a presented batch
//!
//! # Example
//!
//! ```rust,ignore
//! use fugue_evo::interactive::prelude::*;
//! use fugue_evo::prelude::*;
//!
//! let mut iga = InteractiveGABuilder::<RealVector>::new()
//! .population_size(12)
//! .evaluation_mode(EvaluationMode::BatchSelection)
//! .batch_size(6)
//! .bounds(bounds)
//! .selection(TournamentSelection::new(2))
//! .crossover(SbxCrossover::new(15.0))
//! .mutation(PolynomialMutation::new(20.0))
//! .build()?;
//!
//! loop {
//! match iga.step(&mut rng) {
//! StepResult::NeedsEvaluation(request) => {
//! let response = present_to_user(&request);
//! iga.provide_response(response);
//! }
//! StepResult::GenerationComplete { generation, .. } => {
//! println!("Generation {} complete", generation);
//! }
//! StepResult::Complete(result) => break,
//! }
//! }
//! ```
/// Prelude for convenient imports