Street: Add get remaining percent capacity()
This commit is contained in:
parent
96a1254ce3
commit
fc6b93697c
@ -57,6 +57,10 @@ public class Street {
|
|||||||
return totalLength -(totalLenthofCar + 0.5*(vehicles.size() - 2));
|
return totalLength -(totalLenthofCar + 0.5*(vehicles.size() - 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPercentRemainingCapacity() {
|
||||||
|
return (int) (capcity()/(this.length*this.numberOfLanes))*100;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean canTakeVehicles( Vehicle vehicle ) {
|
public boolean canTakeVehicles( Vehicle vehicle ) {
|
||||||
if ( vehicle.getVehicleSize() > capcity() )
|
if ( vehicle.getVehicleSize() > capcity() )
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user