File size: 561 Bytes
ae32abe
 
 
f093ab7
 
 
 
 
 
 
 
 
 
 
ae32abe
f093ab7
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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,
    )
}