Skip done vehicles:
Skip done cars improves perf greatly. Tested in parallel with previous commit and results in faster exc when sim has more/less generated cars.
This commit is contained in:
parent
7ffbe689bc
commit
200c06bfac
@ -438,7 +438,7 @@ public class MakkahCity {
|
||||
clearDoneCivilVehicles();
|
||||
addCivilVehicleNoise();
|
||||
for (Vehicle vehicle : listOfVehicles) {
|
||||
if (vehicle.getRoute() == null)
|
||||
if (vehicle.getRoute() == null || vehicle.isArrivedToDest())
|
||||
continue;
|
||||
Route route = vehicle.getRoute();
|
||||
double currentLocation = vehicle.getCurrentLocation();
|
||||
@ -502,7 +502,7 @@ public class MakkahCity {
|
||||
clearDoneCivilVehicles();
|
||||
addCivilVehicleNoise();
|
||||
for (Vehicle vehicle : listOfVehicles) {
|
||||
if (vehicle.getRoute() == null)
|
||||
if (vehicle.getRoute() == null || vehicle.isArrivedToDest())
|
||||
continue;
|
||||
Route route = vehicle.getRoute();
|
||||
double currentLocation = vehicle.getCurrentLocation();
|
||||
|
Loading…
Reference in New Issue
Block a user