Skip to content
Snippets Groups Projects
Commit 4e4013dd authored by ThibautDemare's avatar ThibautDemare
Browse files

Filter on moving vehicle (don't need to consider vehicles which have not already left the building)

parent d1cbed35
No related branches found
No related tags found
No related merge requests found
...@@ -770,6 +770,7 @@ global { ...@@ -770,6 +770,7 @@ global {
int sumMaritime <- 0; int sumMaritime <- 0;
int sumSecondary <- 0; int sumSecondary <- 0;
ask Vehicle { ask Vehicle {
if(readyToMove and destination != nil){
if(networkType = "road"){ if(networkType = "road"){
averageRoadVehicleOccupancy <- averageRoadVehicleOccupancy + currentTransportedVolume; averageRoadVehicleOccupancy <- averageRoadVehicleOccupancy + currentTransportedVolume;
sumRoad <- sumRoad + 1; sumRoad <- sumRoad + 1;
...@@ -787,6 +788,7 @@ global { ...@@ -787,6 +788,7 @@ global {
sumSecondary <- sumSecondary + 1; sumSecondary <- sumSecondary + 1;
} }
} }
}
if(sumRoad > 0){ if(sumRoad > 0){
averageRoadVehicleOccupancy <- averageRoadVehicleOccupancy / sumRoad; averageRoadVehicleOccupancy <- averageRoadVehicleOccupancy / sumRoad;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment