Skip to main content

Crate solverforge

Crate solverforge 

Source
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§

prelude
stream
Fluent constraint stream API.

Structs§

BendableScore
A score with a configurable number of hard and soft levels.
ConstraintAnalysis
Analysis of a single constraint’s contribution to the score.
HardMediumSoftScore
A score with hard, medium, and soft constraint levels.
HardSoftDecimalScore
A score with separate hard and soft constraint levels, using i64 with x100000 scaling.
HardSoftScore
A score with separate hard and soft constraint levels.
IncrementalBiConstraint
IncrementalUniConstraint
ScoreAnalysis
Result of analyzing a solution’s constraints.
SimpleScore
A simple score with a single integer value.
SolutionManager
Stateless service for score analysis.
SolverManager
Manages async solve jobs with channel-based solution streaming.
TypedScoreDirector

Enums§

SolverStatus
Status of a solving job.

Traits§

Analyzable
Trait for solutions that can be analyzed for constraint violations.
ConstraintSet
IncrementalConstraint
Score
Core trait for all score types in SolverForge.
ScoreDirector
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.

Attribute Macros§

planning_entity
planning_solution
problem_fact

Derive Macros§

PlanningEntityImpl
PlanningSolutionImpl
ProblemFactImpl