SolverForge

Learn More Download

Write constraints like you write code.

Model your planning problems with an expressive, business-object oriented syntax

constraints.rs
// =========================================================================
// HARD: One Shift Per Day
// =========================================================================
let one_per_day = factory
    .clone()
    .for_each_unique_pair(
        |s: &EmployeeSchedule| s.shifts.as_slice(),
        joiner::equal(|shift: &Shift| (shift.employee_idx, shift.date())),
    )
    .filter(|a: &Shift, b: &Shift| a.employee_idx.is_some() && b.employee_idx.is_some())
    .penalize(HardSoftDecimalScore::ONE_HARD)
    .as_constraint("One shift per day");

Get started in seconds
bash - solverforge
git clone https://github.com/SolverForge/solverforge-quickstarts
cd solverforge-quickstarts/rust/employee-scheduling
cargo run