File size: 543 Bytes
2574e86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::constraints::route_metrics::{
    time_windows_match_count, time_windows_score, RouteConstraint,
};
use crate::domain::FieldServicePlan;
use solverforge::prelude::*;
use solverforge::IncrementalConstraint;

/// HARD: each visit must start no later than its latest service minute.
pub fn constraint() -> impl IncrementalConstraint<FieldServicePlan, HardSoftScore> {
    RouteConstraint::new(
        "Time Windows",
        true,
        HardSoftScore::of(1, 0),
        time_windows_score,
        time_windows_match_count,
    )
}