36 inline static const std::string DefaultCarName =
"Railcar";
60 Car(
double carLength_m,
double carDragCoef,
double carFrontalArea_sqm,
61 double carEmptyWeight_t,
double carCurrentWeight_t,
int carNoOfAxles,
62 int carType,
double auxiliaryPower_kw = EC::DefaultCarAuxiliaryPower,
63 double batteryMaxCapacity_kWh = EC::DefaultCarBatteryMaxCapacity,
64 double batteryInitialCharge_perc = EC::DefaultCarBatteryInitialCharge,
65 double tenderMaxCapacity_kg_l = EC::DefaultCarTenderMaxCapacity,
66 double tenderInitialCapacity_perc = EC::DefaultCarTenderInitialCapacity,
67 std::string carName = DefaultCarName);
114 std::pair<bool, double>
consumeFuel(
double timeStep,
double trainSpeed,
double EC_kwh,
115 double carVirtualTractivePower = std::numeric_limits<double>::quiet_NaN(),
116 double dieselConversionFactor = EC::DefaultDieselConversionFactor,
117 double biodieselConversionFactor = EC::DefaultBiodieselConversionFactor,
118 double hydrogenConversionFactor = EC::DefaultHydrogenConversionFactor,
119 double dieselDensity = EC::DefaultDieselDensity,
120 double biodieselDensity = EC::DefaultBioDieselDensity,
121 double hydrogenDensity = EC::DefaultHydrogenDensity)
override;
A rail car.
Definition car.h:29
void setCarCurrentWeight(double newCurrentWeight)
Sets the car's current weight.
Definition car.cpp:74
std::pair< bool, double > consumeFuel(double timeStep, double trainSpeed, double EC_kwh, double carVirtualTractivePower=std::numeric_limits< double >::quiet_NaN(), double dieselConversionFactor=EC::DefaultDieselConversionFactor, double biodieselConversionFactor=EC::DefaultBiodieselConversionFactor, double hydrogenConversionFactor=EC::DefaultHydrogenConversionFactor, double dieselDensity=EC::DefaultDieselDensity, double biodieselDensity=EC::DefaultBioDieselDensity, double hydrogenDensity=EC::DefaultHydrogenDensity) override
Consumes fuel from the tender.
Definition car.cpp:113
double getResistance(double trainSpeed) override
Gets the resistance contributed by this car to the whole train.
Definition car.cpp:92
TrainTypes::CarType carType
The type of the car.
Definition car.h:40
double getCargoNetWeight()
Gets the cargo net weight.
Definition car.cpp:81
double getEnergyConsumption(double &timeStep)
Gets the energy consumption of the car (in case there is auxiliary power).
Definition car.cpp:107
double getMaxProvidedEnergy(double &timeStep)
Gets the maximum energy provided by the car.
Definition car.cpp:146
bool canProvideEnergy(double &EC, double &timeStep)
Checks if the car can provide energy.
Definition car.cpp:161
friend std::ostream & operator<<(std::ostream &ostr, Car &stud)
Stream insertion operator.
Defines a train component base class.
Definition traincomponent.h:24
Definition energyconsumption.cpp:6
_CarType
Values that represent car types.
Definition traintypes.h:23