Expand description
SolverForge - A Constraint Solver in Rust
SolverForge is a constraint satisfaction/optimization solver inspired by Timefold. It helps you optimize planning and scheduling problems.
§Quick Start
use solverforge::prelude::*;
#[problem_fact]
pub struct Employee {
#[planning_id]
pub id: i64,
pub name: String,
}
#[planning_entity]
pub struct Shift {
#[planning_id]
pub id: i64,
#[planning_variable]
pub employee: Option<i64>,
}
#[planning_solution]
pub struct Schedule {
#[problem_fact_collection]
pub employees: Vec<Employee>,
#[planning_entity_collection]
pub shifts: Vec<Shift>,
#[planning_score]
pub score: Option<HardSoftScore>,
}Modules§
Structs§
- Bendable
Score - A score with a configurable number of hard and soft levels.
- Constraint
Analysis - Analysis of a single constraint’s contribution to the score.
- Hard
Medium Soft Score - A score with hard, medium, and soft constraint levels.
- Hard
Soft Decimal Score - A score with separate hard and soft constraint levels, using i64 with ×100000 scaling.
- Hard
Soft Score - A score with separate hard and soft constraint levels.
- Incremental
BiConstraint - Zero-erasure incremental bi-constraint for self-joins.
- Incremental
UniConstraint - Zero-erasure incremental uni-constraint.
- Score
Analysis - Result of analyzing a solution’s constraints.
- Simple
Score - A simple score with a single integer value.
- Solution
Manager - Stateless service for score analysis.
- Solver
Manager - Manages async solve jobs with channel-based solution streaming.
- Typed
Score Director - A typed score director for zero-erasure incremental scoring.
Enums§
- Solver
Status - Status of a solving job.
Traits§
- Analyzable
- Trait for solutions that can be analyzed for constraint violations.
- Constraint
Set - Incremental
Constraint - A single constraint with incremental scoring capability.
- Score
- Core trait for all score types in SolverForge.
- Score
Director - The score director manages solution state and score calculation.
- Solvable
- Trait for solutions that can be solved with channel-based solution streaming.
Functions§
- run_
solver - Solves a basic variable problem using construction heuristic + late acceptance local search.
- run_
solver_ with_ channel - Solves a basic variable problem with channel-based solution streaming.