Skip to main content

solverforge_config/
forager.rs

1use serde::{Deserialize, Serialize};
2
3// Forager configuration.
4#[derive(Debug, Clone, Deserialize, Serialize)]
5#[serde(tag = "type", rename_all = "snake_case")]
6pub enum ForagerConfig {
7    // Retain up to N accepted candidates and pick the best.
8    AcceptedCount(AcceptedCountForagerConfig),
9
10    // Evaluate the full neighborhood and pick the best accepted move.
11    BestScore,
12
13    // Pick the first accepted move.
14    FirstAccepted,
15
16    // Stop on the first move improving the phase-best score.
17    FirstBestScoreImproving,
18
19    // Stop on the first move improving the previous step score.
20    FirstLastStepScoreImproving,
21}
22
23// Accepted-count forager configuration.
24#[derive(Debug, Clone, Default, Deserialize, Serialize)]
25#[serde(rename_all = "snake_case")]
26pub struct AcceptedCountForagerConfig {
27    pub limit: Option<usize>,
28}