fix T-ALNS-RRD reproduction fidelity

This commit is contained in:
皇甫其逊
2026-06-02 21:58:34 +08:00
parent d803a5bec0
commit 6d829fe7d9
12 changed files with 450 additions and 109 deletions

View File

@@ -147,7 +147,12 @@ class ProblemContext:
return (self.op_end - self.op_start) / self.n_intervals
def time_to_interval(self, minutes: float) -> int:
"""Map time in minutes to interval index h ∈ [0, n_intervals-1]."""
"""Map time to interval h.
The paper discretizes traffic feeds for 6:00-18:00. Customer windows may
extend to 20:00, so departures after the final traffic bucket use
hold-last-value semantics instead of extrapolating unobserved traffic.
"""
minutes = max(self.op_start, min(minutes, self.op_end - 1))
return int((minutes - self.op_start) / self.interval_duration)