solverforge-fsr / src /constraints /priority_slack.rs
blackopsrepl's picture
feat(fsr): add snapshot-scoped route geometry
ae32abe
raw
history blame contribute delete
561 Bytes
use crate::constraints::route_metrics::{
priority_slack_match_count, priority_slack_score, RouteConstraint,
};
use crate::domain::FieldServicePlan;
use solverforge::prelude::*;
use solverforge::IncrementalConstraint;
/// SOFT: reward serving high-priority visits with slack before their deadline.
pub fn constraint() -> impl IncrementalConstraint<FieldServicePlan, HardSoftScore> {
RouteConstraint::new(
"Priority Slack",
false,
HardSoftScore::of(0, 1),
priority_slack_score,
priority_slack_match_count,
)
}