43 #ifdef CHECK_MEMORY_LEAKS 45 #endif // CHECK_MEMORY_LEAKS 72 SUMOReal new_AirDragCoefficient = 0.4;
73 SUMOReal new_InternalMomentOfInertia = 10;
74 SUMOReal new_RadialDragCoefficient = 1;
75 SUMOReal new_RollDragCoefficient = 0.5;
76 SUMOReal new_ConstantPowerIntake = 10;
77 SUMOReal new_PropulsionEfficiency = 0.5;
78 SUMOReal new_RecuperationEfficiency = 0;
87 new_ActBatKap = new_MaxBatKap / 2.0;
124 new_ActBatKap, new_MaxBatKap, new_PowerMax, new_Mass, new_FrontSurfaceArea, new_AirDragCoefficient,
125 new_InternalMomentOfInertia, new_RadialDragCoefficient, new_RollDragCoefficient,
126 new_ConstantPowerIntake, new_PropulsionEfficiency, new_RecuperationEfficiency,
127 new_LastAngle, new_LastEnergy);
129 into.push_back(device);
169 if (ChargingStationID !=
"") {
258 MSDevice_Battery::MSDevice_Battery(
SUMOVehicle& holder,
const std::string&
id,
const SUMOReal new_ActBatKap,
const SUMOReal new_MaxBatKap,
const SUMOReal new_PowerMax,
const SUMOReal new_Mass,
const SUMOReal new_FrontSurfaceArea,
const SUMOReal new_AirDragCoefficient,
const SUMOReal new_InternalMomentOfInertia,
const SUMOReal new_RadialDragCoefficient,
const SUMOReal new_RollDragCoefficient,
const SUMOReal new_ConstantPowerIntake,
const SUMOReal new_PropulsionEfficiency,
const SUMOReal new_RecuperationEfficiency,
const SUMOReal new_LastAngle,
const SUMOReal new_LastEnergy)
332 if (PropulsionEfficiency < 0 || PropulsionEfficiency > 1) {
336 if (RecuperationEfficiency < 0 || RecuperationEfficiency > 1) {
440 if (PropulsionEfficiency < 0 || PropulsionEfficiency > 1) {
449 if (RecuperationEfficiency < 0 || RecuperationEfficiency > 1) {
576 currentEnergy +=
getMass() * 9.81 * height_cur;
587 if (radius < 0.0001) {
589 }
else if (radius > 10000) {
628 if (EnergyLoss > 0) {
637 EnergyLoss = EnergyLoss / 3600 ;
647 std::ostringstream convert;
649 return convert.str();
bool isChargingStopped() const
Get parameter 15, true if Vehicle it's charging, false if not.
SUMOReal getPropEnergy(SUMOVehicle &veh)
get propulsion energy
void setFrontSurfaceArea(const SUMOReal new_FrontSurfaceArea)
Set parameter 05, vehicle's front surface Area.
SUMOReal getFrontSurfaceArea() const
Get parameter 05, vehicle's front surface Area.
SUMOReal getConsum() const
Get parameter 18, consum (Strange error with linker)
void setPowerMax(const SUMOReal new_Pmax)
Set parameter 03, The maximum power when accelerating.
SUMOReal ActBatKap
Parameter 01, The actual vehicles' Battery Capacity in kWh [ActBatKap <= MaxBatKap].
void increaseVehicleStoppedTimer()
Set parameter 21a, increase vehicleStopped.
static SUMOReal _2SUMOReal(const E *const data)
SUMOReal ChargingStartTime
Parameter 17, Moment, wich the vehicle has beging to charging none.
SUMOReal getLength() const
Returns the lane's length.
virtual SUMOReal getPositionOnLane() const =0
Get the vehicle's position along the lane.
virtual SUMOReal getAngle() const =0
Get the vehicle's angle.
Notification
Definition of a vehicle state.
SUMOReal energyCharged
Parameter 20, Energy charged in each timestep.
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
MSChargingStation * getChargingStation(const std::string &id) const
Returns the named charging station.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
void setConstantPowerIntake(const SUMOReal new_ConstantPowerIntake)
Set parameter 10, vehicles' constant power intake.
SUMOReal getRadialDragCoefficient() const
Get parameter 08, vehicles' radial friction coefficient.
int getVehicleStopped() const
Get parameter 20, charging energy.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks for waiting steps when the vehicle moves // IMPLEMENTADA!!
SUMOReal getRollDragCoefficient() const
Get parameter 09, vehicles' roll friction coefficient.
SUMOReal MaxBatKap
Parameter 02, The total vehicles' Battery Capacity in kWh [MaxBatKap >= 0].
SUMOReal getAirDragCoefficient() const
Get parameter 06, vehicle's drag coefficient.
SUMOReal beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position ...
const std::string & getParameter(const std::string &key, const std::string &defaultValue) const
Returns the value for a given key.
static SUMOReal angleDiff(const SUMOReal angle1, const SUMOReal angle2)
Returns the difference of the second angle to the first angle in radiants.
#define WRITE_WARNING(msg)
SUMOReal getMaximumPower() const
Get parameter 03, the maximum power when accelerating.
static OptionsCont & getOptions()
Retrieves the options.
void setMaximumBatteryCapacity(const SUMOReal new_MaxBatKap)
Set parameter 02, The total vehicles' Battery Capacity in kWh.
const std::string & getID() const
Returns the id.
SUMOReal getConstantPowerIntake() const
Get parameter 10, vehicles' constant power intake.
void resetVehicleStoppedTimer()
Set parameter 21a, reset vehicleStopped.
int vehicleStopped
Parameter 21, How many timestep the vehicle is stopped.
std::string SUMOReal_str(const SUMOReal &var)
convert from SUMOReal to String
const SUMOVTypeParameter & getParameter() const
Representation of a vehicle.
SUMOReal getChrgPower() const
Get parameter 01, charging station's charging power.
SUMOReal PowerMax
Parameter 03, The Maximum Power when accelerating [PowerMax >= 0].
SUMOReal getLastAngle() const
Get parameter 13, vehicles' last angle.
SUMOReal RollDragCoefficient
Parameter 09, Vehicles' roll friction coefficient [RollDragCoefficient >= 0].
bool ItsChargingStopped
Parameter 15, Flag: Vehicles it's charging stopped by default is false.
void resetChargingStartTime()
Set parameter 17a, reset charging start time.
void setMass(const SUMOReal new_Mass)
Set parameter 04, vehicle's Mass.
SUMOReal getActualBatteryCapacity() const
Get parameter 01, the actual vehicles' Battery Capacity in kWh.
SUMOReal getEfficency() const
Get parameter 02, efficiency of the charging station.
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc)
Adds common command options that allow to assign devices to vehicles.
SUMOReal LastEnergy
Parameter 14, Vehicles' last energy none.
SUMOReal getChargeInTransit() const
Get parameter 03, get chargeInTransit.
SUMOReal getChargeDelay() const
Get parameter 03, get Charge Delay.
SUMOReal getPropulsionEfficiency() const
Get parameter 11, vehicles' Propulsion efficiency.
bool isChargingInTransit() const
Get parameter 16, true if Vehicle it's charging, false if not.
SUMOReal LastAngle
Parameter 13, Vehicles' last angle none.
SUMOReal getChrgEnergy() const
Get parameter 20, charging energy.
SUMOReal getChargingStartTime() const
Get parameter 17, charging start time.
SUMOReal PropulsionEfficiency
Parameter 11, Vehicles' propulsion efficiency [1 >= PropulsionEfficiency >= 0].
bool ItsChargingInTransit
Parameter 16, Flag: Vehicles it's charging in transit by default is false.
MSDevice_Battery(SUMOVehicle &holder, const std::string &id, const SUMOReal new_ActBatKap, const SUMOReal new_MaxBatKap, const SUMOReal new_PowerMax, const SUMOReal new_Mass, const SUMOReal new_FrontSurfaceArea, const SUMOReal new_AirDragCoefficient, const SUMOReal new_InternalMomentOfInertia, const SUMOReal new_RadialDragCoefficient, const SUMOReal new_RollDragCoefficient, const SUMOReal new_ConstantPowerIntake, const SUMOReal new_PropulsionEfficiency, const SUMOReal new_RecuperationEfficiency, const SUMOReal new_LastAngle, const SUMOReal new_LastEnergy)
Constructor.
SUMOReal getRecuperationEfficiency() const
Get parameter 12, vehicles' Recuparation efficiency.
void setRadialDragCoefficient(const SUMOReal new_RadialDragCoefficient)
Set parameter 08, Vehicles' radial friction coefficient.
SUMOReal Consum
Parameter 18, Vehicle consum during a time step by default is 0.
Abstract in-vehicle device.
void setRollDragCoefficient(const SUMOReal new_RollDragCoefficient)
Set parameter 09, vehicles' roll friction coefficient.
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, SUMOVehicle &v)
Determines whether a vehicle should get a certain device.
void setRecuperationEfficiency(const SUMOReal new_RecuperationEfficiency)
Set parameter 12, vehicles' Recuparation efficiency.
The vehicle has departed (was inserted into the network)
virtual SUMOReal getSpeed() const =0
Returns the vehicle's current speed.
The battery parametereter.
SUMOReal getLastEnergy() const
Get parameter 14, vehicles' last Energy.
SUMOReal InternalMomentOfInertia
Parameter 07, Vehicles' internal moment of inertia [InternalMomentOfInertia >= 0].
SUMOReal RadialDragCoefficient
Parameter 08, Vehicles' radial friction coefficient [RadialDragCoefficient >=0]. ...
SUMOReal Mass
Parameter 04, Vehicle's Mass [Mass >= 0].
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
void increaseChargingStartTime()
Set parameter 17b, increase Charging Start time.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
void setPropulsionEfficiency(const SUMOReal new_PropulsionEfficiency)
Set parameter 11, vehicles' Propulsion efficiency.
void setInternalMomentOfInertia(const SUMOReal new_InternalMomentOfInertia)
Set parameter 07, vehicles' internal moment of inertia.
A storage for options typed value containers)
std::string actChargingStation
Parameter 19, Vehicle consum during a time step by default is "".
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Saves departure info on insertion.
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
SUMOReal AirDragCoefficient
Parameter 06, Vehicle's drag coefficient [AirDragCoefficient >=0].
const PositionVector & getShape() const
Returns this lane's shape.
void setLastEnergy(const SUMOReal new_LastEnergy)
Set parameter 14, vehicles' last Energy.
SUMOReal FrontSurfaceArea
Parameter 05, Vehicle's front surface Area [FrontSurfaceArea >= 0].
void setActualBatteryCapacity(const SUMOReal new_ActBatKap)
Set parameter 01, The actual vehicles' Battery Capacity in kWh.
std::string getChargingStationID(const MSLane *lane, const SUMOReal pos) const
Returns the charging station close to the given position.
SUMOReal ConstantPowerIntake
Parameter 10, Vehicles' constant power intake [ConstantPowerIntake >= 0].
SUMOReal getMaximumBatteryCapacity() const
Get parameter 02, the total vehicles' Battery Capacity in kWh.
SUMOReal RecuperationEfficiency
Parameter 12, Vehicles' recuparation efficiency [1 >= RecuperationEfficiency >= 0].
void setAirDragCoefficient(const SUMOReal new_C_Veh)
Set parameter 06, vehicle's drag coefficient.
void generateOutput() const
Called on writing tripinfo output.
SUMOReal getInternalMomentOfInertia() const
Get parameter 07, vehicles' internal moment of inertia.
virtual const std::string & getID() const =0
Get the vehicle's ID.
void setLastAngle(const SUMOReal new_LastAngle)
Set parameter 13, vehicles' last Angle.
SUMOReal getMass() const
Get parameter 04, vehicle's Mass.
const std::string & getChargingStationID() const
Get parameter 19, Charging Station I.
~MSDevice_Battery()
Destructor.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.