Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2020-12-02 02:17:07 +03:00
parent 177e22ef13
commit afb2b85643
Signed by: Hesham
GPG Key ID: 74876157D199B09E
2 changed files with 7 additions and 11 deletions

View File

@ -132,7 +132,6 @@ public class MakkahCity {
}
inputListener.stop();
t.interrupt();
//TODO: print final report
}
private static void checkInput() {
@ -391,7 +390,6 @@ public class MakkahCity {
}
private static void addCivilVehicleNoise() {
//TODO: rewrite to avoid factoring (deviding) the values down to zero.
for (Street street: stdStreet) {
if (street.getPercentRemainingCapacity() >= 100)
@ -530,7 +528,6 @@ public class MakkahCity {
for (Campaign campaign : listOfCampaigns) {
numberOfBusses += campaign.getNumberOfBusses();
} //TODO Add max min time.
//TODO: And print all routes with their streets.
String fFormat = "All arrived to %s at: %s";
boolean arr = isAllArrived();//since it has looping. use once.
if (arr && allArrivedToArafatTime != null)
@ -652,7 +649,6 @@ public class MakkahCity {
return report.toString();
}
//TODO: Bug: values are too low for second day (8, 9, 12 minutes?)
//This is for ALL vehicles, should make it for last hour to be consistent with the report.
public static String avgTimeOnStreet(Street street) {
int sum = 0;

View File

@ -147,13 +147,13 @@ public class Street implements Travelable {
return capcity;
}
public Street getNextStreet(Vehicle vehicle) {
int nextIndex = vehicle.getRoute().indexOf(vehicle.getCurrentStreet()) +1 ;
if(vehicle.getRoute().getStreets().length > nextIndex)
return (vehicle.getRoute().getStreets()[nextIndex]);
else
return null;
}
public Street getNextStreet(Vehicle vehicle) {
int nextIndex = vehicle.getRoute().indexOf(vehicle.getCurrentStreet()) +1 ;
if(vehicle.getRoute().getStreets().length > nextIndex)
return (vehicle.getRoute().getStreets()[nextIndex]);
else
return null;
}
public int getNumberOfBuses() {
int number = 0;