Merge branch 'master' into master
This commit is contained in:
commit
f3258355fe
@ -14,7 +14,9 @@ public class MakkahCity {
|
||||
generateCamps(District.ALAZIZIYA, getRandom(70, 100));
|
||||
generateCamps(District.ALMANSOOR, getRandom(110, 160));
|
||||
generateCamps(District.ALHIJRA, getRandom(80, 110));
|
||||
|
||||
|
||||
fillBusesToList();
|
||||
|
||||
//Make Streets
|
||||
makeStreets();
|
||||
|
||||
@ -60,6 +62,8 @@ public class MakkahCity {
|
||||
}
|
||||
|
||||
private static void fillBusesToList() {
|
||||
//TODO: add all buses from campaigns to vehiclesList
|
||||
for (Campaign camp : allCampgains) {
|
||||
vehiclesList.addAll(camp.getVehicles());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ public class Street {
|
||||
setNumberOfLanes(numberOfLanes);
|
||||
}
|
||||
|
||||
//TODO: should be removed. list can be over the capacity Unless we check with street cap.
|
||||
public Street(double length, int numberOfLanes, ArrayList<Vehicle> vehicles) {
|
||||
this(length, numberOfLanes);
|
||||
this.vehicles = vehicles;
|
||||
@ -56,6 +57,10 @@ public class Street {
|
||||
}
|
||||
return totalLength -(totalLenthofCar + 0.5*(vehicles.size() - 2));
|
||||
}
|
||||
|
||||
public int getPercentRemainingCapacity() {
|
||||
return (int) (capcity()/(this.length*this.numberOfLanes))*100;
|
||||
}
|
||||
|
||||
public boolean canTakeVehicles( Vehicle vehicle ) {
|
||||
if ( vehicle.getVehicleSize() > capcity() )
|
||||
|
Loading…
Reference in New Issue
Block a user