Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
eckter committed Jan 7, 2025
1 parent d9a0f84 commit 77d5703
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ fun incrementalConflictDetectorFromReq(
* trains, and new requirements come from the train we are trying to fit in the timetable.
*/
class IncrementalConflictDetector(requirements: List<Requirements>) {
// Zone name -> (end time -> Range(start time, end time))
// Zone name -> (end time -> Range(start time, end time)).
// The range is partially redundant, but it makes for easier and clearer processing.
private val spacingZoneUses: Map<String, TreeMap<Double, Range<Double>>>

init {
Expand Down Expand Up @@ -128,6 +129,9 @@ class IncrementalConflictDetector(requirements: List<Requirements>) {
spacingRequirements: List<SpacingRequirement>,
): Double {
var minDelay = 0.0
// We iterate until the requirements fit in the timetable,
// shifting them later whenever a conflict is detected.
// We stop once we go for a whole loop without conflict.
while (true) {
var hasIncreasedDelay = false
for (spacingRequirement in spacingRequirements) {
Expand Down

0 comments on commit 77d5703

Please sign in to comment.