District report:
- Add best time to dist Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
ba02114562
commit
19291fbfe1
@ -539,13 +539,15 @@ public class MakkahCity {
|
|||||||
private static String preSimulationReport() {
|
private static String preSimulationReport() {
|
||||||
StringBuilder report = new StringBuilder();
|
StringBuilder report = new StringBuilder();
|
||||||
report.append("******************************District details******************************\n");
|
report.append("******************************District details******************************\n");
|
||||||
report.append("District | Campaigns | Busses | Est. time to Arafat | Est. time to District \n");
|
report.append("District | Campaigns | Busses | Best time to Arafat | Best time to District \n");
|
||||||
for (int i = 0; i < campPerDistrict.length; i++) {
|
for (int i = 0; i < campPerDistrict.length; i++) {
|
||||||
//Per District, i denotes district index
|
//Per District, i denotes district index
|
||||||
report.append(String.format("%-9s|",campPerDistrict[i].get(0).getHotelDistrict().name()));
|
report.append(String.format("%-9s|",campPerDistrict[i].get(0).getHotelDistrict().name()));
|
||||||
|
|
||||||
report.append(String.format(" %-10d|",campPerDistrict[i].size()));
|
report.append(String.format(" %-10d|",campPerDistrict[i].size()));
|
||||||
report.append(String.format(" %-7d|", busesInDistrict(District.values()[i])));
|
report.append(String.format(" %-7d|", busesInDistrict(District.values()[i])));
|
||||||
|
report.append(String.format(" %-20s|", getShortestRoute(campPerDistrict[i].get(0), Mashier.ARAFAT).getFastestTimeOfTravel(new Bus())));
|
||||||
|
report.append(String.format(" %-20s|", getShortestRoute(campPerDistrict[i].get(0), Mashier.MINA).getFastestTimeOfTravel(new Bus())));
|
||||||
//Calc values per dist here.
|
//Calc values per dist here.
|
||||||
|
|
||||||
report.append("\n");
|
report.append("\n");
|
||||||
|
@ -38,7 +38,7 @@ public class Route {
|
|||||||
double totalLength = getTotalLength();
|
double totalLength = getTotalLength();
|
||||||
int maxSpeed = vehicle.getMaxSpeed();
|
int maxSpeed = vehicle.getMaxSpeed();
|
||||||
int totalTime = (int) (totalLength/maxSpeed);
|
int totalTime = (int) (totalLength/maxSpeed);
|
||||||
String result = String.format("%2d:%2d",totalTime % 60, totalTime /60);
|
String result = String.format("%02d:%02d",totalTime / 60, totalTime % 60);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user