Configuration

TOML-based solver configuration with SolverConfig.

SolverForge uses TOML for solver configuration. You can load configuration from a file or build it from a string.

Loading Configuration

From a TOML file

let config = SolverConfig::load("solver-config.toml").unwrap();

From a TOML string

let config = SolverConfig::from_toml_str(r#"
    environment_mode = "reproducible"
    move_thread_count = 4

    [termination]
    seconds_spent_limit = 120

    [[phases]]
    type = "construction_heuristic"
    construction_heuristic_type = "first_fit"

    [[phases]]
    type = "local_search"
    [phases.acceptor]
    type = "late_acceptance"
    late_acceptance_size = 400
"#).unwrap();

Example TOML File

environment_mode = "non_reproducible"
move_thread_count = "auto"

[termination]
seconds_spent_limit = 300
unimproved_seconds_spent_limit = 60

[[phases]]
type = "construction_heuristic"
construction_heuristic_type = "first_fit"

[[phases]]
type = "local_search"

[phases.acceptor]
type = "simulated_annealing"
starting_temperature = "0hard/500soft"

[phases.termination]
step_count_limit = 100000

Configuration Options

Environment Mode

Controls reproducibility and assertion levels.

ModeDescription
reproducibleDeterministic — same input always produces the same output. Slower.
non_reproducibleNon-deterministic — fastest mode for production use
fast_assertEnables light assertions for debugging
full_assertEnables all assertions — slowest, for development only
environment_mode = "non_reproducible"

Move Thread Count

Controls multi-threaded move evaluation.

move_thread_count = 4        # Fixed thread count
move_thread_count = "auto"   # Use available cores
move_thread_count = "none"   # Single-threaded (default)

Phases

Phases run in sequence. A typical configuration uses construction heuristic followed by local search:

[[phases]]
type = "construction_heuristic"
construction_heuristic_type = "first_fit"

[[phases]]
type = "local_search"
[phases.acceptor]
type = "tabu_search"
entity_tabu_size = 7

See Phases for all phase types and their options.

Termination

Controls when the solver stops. See Termination for all options.

[termination]
seconds_spent_limit = 300

See Also