Commit 4e4013dd authored by ThibautDemare's avatar ThibautDemare

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

parent d1cbed35
......@@ -770,21 +770,23 @@ global {
int sumMaritime <- 0;
int sumSecondary <- 0;
ask Vehicle {
if(networkType = "road"){
averageRoadVehicleOccupancy <- averageRoadVehicleOccupancy + currentTransportedVolume;
sumRoad <- sumRoad + 1;
}
else if(networkType = "river"){
averageRiverVehicleOccupancy <- averageRiverVehicleOccupancy + currentTransportedVolume;
sumRiver <- sumRiver + 1;
}
else if(networkType = "maritime"){
averageMaritimeVehicleOccupancy <- averageMaritimeVehicleOccupancy + currentTransportedVolume;
sumMaritime <- sumMaritime + 1;
}
else if(networkType = "secondary"){
averageSecondaryVehicleOccupancy <- averageSecondaryVehicleOccupancy + currentTransportedVolume;
sumSecondary <- sumSecondary + 1;
if(readyToMove and destination != nil){
if(networkType = "road"){
averageRoadVehicleOccupancy <- averageRoadVehicleOccupancy + currentTransportedVolume;
sumRoad <- sumRoad + 1;
}
else if(networkType = "river"){
averageRiverVehicleOccupancy <- averageRiverVehicleOccupancy + currentTransportedVolume;
sumRiver <- sumRiver + 1;
}
else if(networkType = "maritime"){
averageMaritimeVehicleOccupancy <- averageMaritimeVehicleOccupancy + currentTransportedVolume;
sumMaritime <- sumMaritime + 1;
}
else if(networkType = "secondary"){
averageSecondaryVehicleOccupancy <- averageSecondaryVehicleOccupancy + currentTransportedVolume;
sumSecondary <- sumSecondary + 1;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment