Improved output
Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
22ee69be52
commit
c7313cd3df
@ -523,11 +523,11 @@ public class MakkahCity {
|
|||||||
else status = " Status: Heading to hotels";
|
else status = " Status: Heading to hotels";
|
||||||
String headerFormat = "******Streets report*****\n" +
|
String headerFormat = "******Streets report*****\n" +
|
||||||
"Time: %s%s\n" +
|
"Time: %s%s\n" +
|
||||||
" Street name |Street Load| Total | Buses | Local Vehicles | Avg. Time\n";
|
" Street name |Street Load| Total | Buses | Local Vehicles | Avg. Time |\n";
|
||||||
|
|
||||||
StringBuilder report = new StringBuilder();
|
StringBuilder report = new StringBuilder();
|
||||||
report.append(String.format(headerFormat, currenttimeManager.getCurrentTime(), status));
|
report.append(String.format(headerFormat, currenttimeManager.getCurrentTime(), status));
|
||||||
String streetFormat = "%-18s | %%%-8s | %5d | %5d | %14d | %-9s";
|
String streetFormat = "%-18s | %%%-8s | %5d | %5d | %14d | %-10s|";
|
||||||
|
|
||||||
for (int i = 0; i < stdStreet.length; i++) {
|
for (int i = 0; i < stdStreet.length; i++) {
|
||||||
int cap = stdStreet[i].getPercentRemainingCapacity();
|
int cap = stdStreet[i].getPercentRemainingCapacity();
|
||||||
@ -567,8 +567,8 @@ public class MakkahCity {
|
|||||||
private static String minMaxRep() {
|
private static String minMaxRep() {
|
||||||
StringBuilder report = new StringBuilder();
|
StringBuilder report = new StringBuilder();
|
||||||
if (Vehicle.getMaxArrived() != null && Vehicle.getMinArrived() != null) {
|
if (Vehicle.getMaxArrived() != null && Vehicle.getMinArrived() != null) {
|
||||||
report.append(String.format(" maximum trip %s", Vehicle.getMaxArrived().timeToString()));
|
report.append(String.format(" Maximum trip %s,", Vehicle.getMaxArrived().timeToString()));
|
||||||
report.append(String.format(" minimum trip %s", Vehicle.getMinArrived().timeToString()));
|
report.append(String.format(" Minimum trip %s", Vehicle.getMinArrived().timeToString()));
|
||||||
}
|
}
|
||||||
return report.toString();
|
return report.toString();
|
||||||
}
|
}
|
||||||
@ -637,7 +637,7 @@ public class MakkahCity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
}//???
|
}
|
||||||
|
|
||||||
private static int getNumberOfArrivedBussesPerHour() {
|
private static int getNumberOfArrivedBussesPerHour() {
|
||||||
Calendar now = currenttimeManager.getCurrentCalendar();
|
Calendar now = currenttimeManager.getCurrentCalendar();
|
||||||
@ -666,16 +666,16 @@ 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 | Avg arrival | Best time to Arafat | Best time to District \n");
|
report.append(" District | Campaigns | Busses | Avg arrival | 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("%-10s|",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(" %%%-11d|", getPercentArrival(District.values()[i])));
|
report.append(String.format(" %%%-11d|", getPercentArrival(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.ARAFAT).getFastestTimeOfTravel(new Bus())));
|
||||||
report.append(String.format(" %-20s", getShortestRoute(campPerDistrict[i].get(0), Mashier.MINA).getFastestTimeOfTravel(new Bus())));
|
report.append(String.format(" %-22s|", 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");
|
||||||
|
Loading…
Reference in New Issue
Block a user