#include <tank.h>
Public Member Functions | |
| void | SetTank (double maxCapacity, double initialCapacityPercentage, double depthOfDischarge) |
| Set the main properties of the tank (initialize the tank) | |
| double | getTankMaxCapacity () const |
| Gets the maximum capacity of the tank. | |
| void | setTankMaxCapacity (double newMaxCapacity) |
| Sets the maximum capacity of the tank. | |
| double | getTankInitialCapacity () const |
| Gets the initial capacity of the tank. | |
| void | setTankInitialCapacity (double newInitialCapacityPercentage) |
| Sets the initial capacity of the tank. | |
| double | getTankCurrentCapacity () const |
| Gets the current capacity of the tank. | |
| double | consumeTank (double consumedAmount) |
| Consumes fuel from the tank. | |
| double | getTankStateOfCapacity () const |
| Gets the state of capacity of the tank. | |
| bool | isTankDrainable (double consumedAmount) |
| Checks if the specified amount of fuel is drainable from the tank. | |
| double | getTankDOD () const |
| Gets the depth of discharge of the tank. | |
| void | setTankDOD (double newTankDOD) |
| Sets the depth of discharge of the tank. | |
| bool | tankHasFuel () |
| Checks if the tank has fuel (current capacity > 0) | |
| double | getTankCumConsumedFuel () const |
| Gets the total amount of fuel consumed from the tank. | |
| double Tank::consumeTank | ( | double | consumedAmount | ) |
Consumes fuel from the tank.
| consumedAmount | The amount of fuel to consume from the tank in liters. |
| double Tank::getTankCumConsumedFuel | ( | ) | const |
Gets the total amount of fuel consumed from the tank.
| double Tank::getTankCurrentCapacity | ( | ) | const |
Gets the current capacity of the tank.
| double Tank::getTankDOD | ( | ) | const |
Gets the depth of discharge of the tank.
| double Tank::getTankInitialCapacity | ( | ) | const |
Gets the initial capacity of the tank.
| double Tank::getTankMaxCapacity | ( | ) | const |
Gets the maximum capacity of the tank.
| double Tank::getTankStateOfCapacity | ( | ) | const |
Gets the state of capacity of the tank.
| bool Tank::isTankDrainable | ( | double | consumedAmount | ) |
Checks if the specified amount of fuel is drainable from the tank.
| consumedAmount | The amount of fuel to be drained from the tank in liters. |
| void Tank::SetTank | ( | double | maxCapacity, |
| double | initialCapacityPercentage, | ||
| double | depthOfDischarge | ||
| ) |
Set the main properties of the tank (initialize the tank)
| maxCapacity | The maximum capacity the tank can hold in liters |
| initialCapacityPercentage | The initial capacity percentage that the tank holds once the train is loaded onto the network. |
| depthOfDischarge | The allowable depth of discharge, the tank can drain to. |
| void Tank::setTankDOD | ( | double | newTankDOD | ) |
Sets the depth of discharge of the tank.
| newTankDOD | The new depth of discharge of the tank. |
| void Tank::setTankInitialCapacity | ( | double | newInitialCapacityPercentage | ) |
Sets the initial capacity of the tank.
| newInitialCapacityPercentage | The new initial capacity percentage of the tank. |
| void Tank::setTankMaxCapacity | ( | double | newMaxCapacity | ) |
Sets the maximum capacity of the tank.
| newMaxCapacity | The new maximum capacity of the tank in liters. |
| bool Tank::tankHasFuel | ( | ) |
Checks if the tank has fuel (current capacity > 0)