blackopsrepl's picture
feat(app): add SolverForge deliveries tutorial app
03e3b1b
raw
history blame contribute delete
961 Bytes
//! Constraint assembly for delivery routing.
//!
//! Each sibling file contributes one named rule. `create_constraints()` lists
//! them in the order we want beginners to see in score analysis output.
use crate::domain::Plan;
use solverforge::prelude::*;
pub use self::assemble::create_constraints;
// @solverforge:begin constraint-modules
mod all_deliveries_assigned;
mod delivery_time_windows;
mod total_travel_time;
mod vehicle_capacity;
// @solverforge:end constraint-modules
mod assemble {
use super::*;
/// Collects the full scoring model used by `Plan`.
pub fn create_constraints() -> impl ConstraintSet<Plan, HardSoftScore> {
// @solverforge:begin constraint-calls
(
all_deliveries_assigned::constraint(),
vehicle_capacity::constraint(),
delivery_time_windows::constraint(),
total_travel_time::constraint(),
)
// @solverforge:end constraint-calls
}
}