82 :
GenericSAXHandler(engineTags, ENGINE_TAG_NOTHING, engineAttrs, ENGINE_ATTR_NOTHING,
"vehicles"),
83 skip(false), currentGear(1) {
105 std::stringstream ss;
106 ss <<
"Invalid gear number " << number <<
". Please check that gears are inserted in order";
156 if (mapType !=
"poly") {
157 throw ProcessError(
TL(
"Invalid engine map type. Only \"poly\" is supported for now"));
165 std::stringstream ss;
166 ss <<
"Maximum degree for the engine polynomial is " <<
MAX_POLY_DEGREE <<
". Please check your model's data";
171 const std::string param =
"x" +
toString(i);
208 for (
int i = 0; i < (int)
gearRatios.size(); i++) {
#define WRITE_WARNINGF(...)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void computeCoefficients()
struct PolynomialEngineModelRpmToHp engineMapping
double tiresFrictionCoefficient
struct GearShiftingRules shiftingRule
A handler which converts occurring elements and attributes into enums.
Encapsulated SAX-Attributes.
virtual std::string getString(int id, bool *isPresent=nullptr) const =0
Returns the string-value of the named (by its enum-value) attribute.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
int getInt(int id) const
Returns the int-value of the named (by its enum-value) attribute.
double getFloat(int id) const
Returns the double-value of the named (by its enum-value) attribute.
@ ENGINE_ATTR_WHEELS_DIAMETER
@ ENGINE_ATTR_ENGINE_MINRPM
@ ENGINE_ATTR_ENGINE_TYPE
@ ENGINE_ATTR_ENGINE_TAU_EX
@ ENGINE_ATTR_MASS_FACTOR
@ ENGINE_ATTR_ENGINE_EFFICIENCY
@ ENGINE_ATTR_SHIFTING_RPM
@ ENGINE_ATTR_ENGINE_POWER_INTERCEPT
@ ENGINE_ATTR_SHIFTING_DELTARPM
@ ENGINE_ATTR_DRAG_SECTION
@ ENGINE_ATTR_WHEELS_FRICTION
@ ENGINE_ATTR_ENGINE_POWER_RPM
@ ENGINE_ATTR_ENGINE_POWER_KW
@ ENGINE_ATTR_ENGINE_TAU_BURN
@ ENGINE_ATTR_ENGINE_MAXRPM
@ ENGINE_ATTR_ENGINE_CYLINDERS
@ ENGINE_ATTR_ENGINE_POWER_HP
@ ENGINE_ATTR_ENGINE_POWER_SLOPE
virtual ~VehicleEngineHandler()
Destructor.
std::vector< double > gearRatios
EngineParameters engineParameters
VehicleEngineHandler(const std::string &toLoad)
void myEndElement(int element)
Called when a closing tag occurs.
@ ENGINE_TAG_GEAR_DIFFERENTIAL
@ ENGINE_TAG_ENGINE_POWER
static SequentialStringBijection::Entry engineAttrs[]
The names of engine-XML attributes (for passing to GenericSAXHandler)
static SequentialStringBijection::Entry engineTags[]
The names of engine-XML elements (for passing to GenericSAXHandler)
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
std::string vehicleToLoad
double x[MAX_POLY_DEGREE]