Skip to content

Commit

Permalink
ev: fix ConcurrentModificationException in VehicleChargingHandler.not…
Browse files Browse the repository at this point in the history
…ifyMobsimBeforeSimStep()
  • Loading branch information
michalmac committed Dec 29, 2023
1 parent a9bfbc7 commit e7dd33e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.matsim.vehicles.Vehicle;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

/**
* This is an events based approach to trigger vehicle charging. Vehicles will be charged as soon as a person begins a charging activity.
Expand All @@ -71,7 +72,7 @@ public class VehicleChargingHandler
private final Map<Id<Person>, Id<Vehicle>> lastVehicleUsed = new HashMap<>();
private final Map<Id<Vehicle>, Id<Person>> lastDriver = new HashMap<>();
private final Map<Id<Vehicle>, Id<Charger>> vehiclesAtChargers = new HashMap<>();
private final Set<Id<Person>> agentsInChargerQueue = new HashSet<>();
private final Set<Id<Person>> agentsInChargerQueue = ConcurrentHashMap.newKeySet();

private final ChargingInfrastructure chargingInfrastructure;
private final ElectricFleet electricFleet;
Expand Down

0 comments on commit e7dd33e

Please sign in to comment.