Skip to content

Commit

Permalink
bug-fix replanning
Browse files Browse the repository at this point in the history
  • Loading branch information
schumifabi committed Sep 12, 2024
1 parent 9102ce7 commit 2e043ea
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ public List<? extends PlanElement> calcRoute(final Facility fromFacility, final
//toDo: Fehler finden!!!
List<ChargerSpecification> nearestChargers = straightLineKnnFinder.findNearest(stopLocation,chargingInfrastructureSpecification.getChargerSpecifications().values().stream().filter(charger -> charger.getChargerType().contains("dc")));

if (nearestChargers.size() < 1) {return basicRoute;}

ChargerSpecification selectedCharger = nearestChargers.get(random.nextInt(nearestChargers.size()));

Link selectedChargerLink =NetworkUtils.getNearestLink(network, selectedCharger.getCoord());
Expand Down

0 comments on commit 2e043ea

Please sign in to comment.