Clean up
Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
177e22ef13
commit
afb2b85643
@ -132,7 +132,6 @@ public class MakkahCity {
|
|||||||
}
|
}
|
||||||
inputListener.stop();
|
inputListener.stop();
|
||||||
t.interrupt();
|
t.interrupt();
|
||||||
//TODO: print final report
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkInput() {
|
private static void checkInput() {
|
||||||
@ -391,7 +390,6 @@ public class MakkahCity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void addCivilVehicleNoise() {
|
private static void addCivilVehicleNoise() {
|
||||||
//TODO: rewrite to avoid factoring (deviding) the values down to zero.
|
|
||||||
|
|
||||||
for (Street street: stdStreet) {
|
for (Street street: stdStreet) {
|
||||||
if (street.getPercentRemainingCapacity() >= 100)
|
if (street.getPercentRemainingCapacity() >= 100)
|
||||||
@ -530,7 +528,6 @@ public class MakkahCity {
|
|||||||
for (Campaign campaign : listOfCampaigns) {
|
for (Campaign campaign : listOfCampaigns) {
|
||||||
numberOfBusses += campaign.getNumberOfBusses();
|
numberOfBusses += campaign.getNumberOfBusses();
|
||||||
} //TODO Add max min time.
|
} //TODO Add max min time.
|
||||||
//TODO: And print all routes with their streets.
|
|
||||||
String fFormat = "All arrived to %s at: %s";
|
String fFormat = "All arrived to %s at: %s";
|
||||||
boolean arr = isAllArrived();//since it has looping. use once.
|
boolean arr = isAllArrived();//since it has looping. use once.
|
||||||
if (arr && allArrivedToArafatTime != null)
|
if (arr && allArrivedToArafatTime != null)
|
||||||
@ -652,7 +649,6 @@ public class MakkahCity {
|
|||||||
return report.toString();
|
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.
|
//This is for ALL vehicles, should make it for last hour to be consistent with the report.
|
||||||
public static String avgTimeOnStreet(Street street) {
|
public static String avgTimeOnStreet(Street street) {
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
@ -147,13 +147,13 @@ public class Street implements Travelable {
|
|||||||
return capcity;
|
return capcity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Street getNextStreet(Vehicle vehicle) {
|
public Street getNextStreet(Vehicle vehicle) {
|
||||||
int nextIndex = vehicle.getRoute().indexOf(vehicle.getCurrentStreet()) +1 ;
|
int nextIndex = vehicle.getRoute().indexOf(vehicle.getCurrentStreet()) +1 ;
|
||||||
if(vehicle.getRoute().getStreets().length > nextIndex)
|
if(vehicle.getRoute().getStreets().length > nextIndex)
|
||||||
return (vehicle.getRoute().getStreets()[nextIndex]);
|
return (vehicle.getRoute().getStreets()[nextIndex]);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNumberOfBuses() {
|
public int getNumberOfBuses() {
|
||||||
int number = 0;
|
int number = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user