Revert capacity()
This commit is contained in:
parent
8bb64bea64
commit
787d2a7fd7
@ -69,18 +69,18 @@ public class Street implements Travelable {
|
||||
for(int i=0;i<vehicles.size();i++) {
|
||||
totalLenthofCar+=vehicles.get(i).getVehicleSize();
|
||||
}
|
||||
// int percent = 0;
|
||||
// if (totalLenthofCar > totalLength){
|
||||
// percent = (int) (totalLength/totalLenthofCar);
|
||||
// percent *= 100;
|
||||
// percent += totalLength - (totalLength % totalLenthofCar);
|
||||
// }
|
||||
// else {
|
||||
// percent = (int)(totalLength - totalLenthofCar);
|
||||
// }
|
||||
//
|
||||
// return percent;
|
||||
return totalLength - totalLenthofCar;
|
||||
int percent = 0;
|
||||
if (totalLenthofCar > totalLength){
|
||||
percent = (int) (totalLength/totalLenthofCar);
|
||||
percent *= 100;
|
||||
percent += totalLength - (totalLength % totalLenthofCar);
|
||||
}
|
||||
else {
|
||||
percent = (int)(totalLength - totalLenthofCar);
|
||||
}
|
||||
|
||||
return percent;
|
||||
//return totalLength - totalLenthofCar;
|
||||
}
|
||||
|
||||
public int getPercentRemainingCapacity() {
|
||||
|
Loading…
Reference in New Issue
Block a user