Skip to content

Commit

Permalink
FIX: #180 - Use LinkedHashMap instead of HashMap to ensure that stop …
Browse files Browse the repository at this point in the history
…indices are not random ordered resulting in undeterministic behavior with multiple solutions.
  • Loading branch information
clukas1 committed Jan 29, 2025
1 parent 2b608f5 commit 38b6c98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/ch/naviqore/raptor/router/RaptorRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private Map<Integer, Integer> validateStopsAndGetIndices(Map<String, Integer> st
}

// loop over all stop pairs and check if stop exists in raptor, then validate departure time
Map<Integer, Integer> validStopIds = new HashMap<>();
Map<Integer, Integer> validStopIds = new LinkedHashMap<>();
for (Map.Entry<String, Integer> entry : stops.entrySet()) {
String stopId = entry.getKey();
int time = entry.getValue();
Expand Down

0 comments on commit 38b6c98

Please sign in to comment.