 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
30 : currentTag(
TAG_VEHICLES), skip(false), currentGear(1) {
45 std::string
getAttributeValue(
const char* attributeName,
const XERCES_CPP_NAMESPACE::Attributes& attrs) {
52 const XMLCh*
const qname,
53 const XERCES_CPP_NAMESPACE::Attributes& attrs) {
162 const XMLCh*
const qname) {
184 for (
int i = 0; i < (int)
gearRatios.size(); i++) {
257 if (mapType !=
"poly") {
258 throw ProcessError(
"Invalid engine map type. Only \"poly\" is supported for now");
269 std::stringstream ss;
270 ss <<
"Invalid gear number " << number <<
". Please check that gears are inserted in order";
289 std::stringstream ss;
290 ss <<
"Maximum degree for the engine polynomial is " <<
MAX_POLY_DEGREE <<
". Please check your model's data";
294 for (
int i = 0; i < (int)attrs.getLength(); i++) {
315 return attrs.getIndex(
transcode(attribute));
319 std::string strValue;
321 if (attributeIndex == -1) {
325 return transcode(attrs.getValue(attributeIndex));
334 std::stringstream ss;
342 std::stringstream ss;
343 ss <<
"Missing attribute \"" << attribute <<
"\" for tag " << tag;
350 std::stringstream ss;
351 ss <<
"I don't know what to do with this tag: " << tag;
std::string getAttributeValue(const char *attributeName, const XERCES_CPP_NAMESPACE::Attributes &attrs)
int existsAttribute(std::string tag, const char *attribute, const XERCES_CPP_NAMESPACE::Attributes &attrs)
struct GearShiftingRules shiftingRule
#define ENGINE_TAG_GEAR_RATIO
#define ENGINE_TAG_VEHICLE_ID
#define ENGINE_TAG_ENGINE_TYPE
void loadWheelsData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
std::string parseStringAttribute(std::string tag, const char *attribute, const XERCES_CPP_NAMESPACE::Attributes &attrs)
void loadBrakesData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_WHEELS_CR2
#define ENGINE_TAG_SHIFTING_DELTARPM
void loadDifferentialData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
#define ENGINE_TAG_MASS_FACTOR
double parsePolynomialCoefficient(int index, const XERCES_CPP_NAMESPACE::Attributes &attrs)
double parseDoubleAttribute(std::string tag, const char *attribute, const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_VEHICLE
void raiseUnknownTagError(std::string tag)
#define ENGINE_TAG_BRAKES_TAU
#define ENGINE_TAG_ENGINE_MINRPM
void loadEngineModelData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_WHEELS_CR1
double tiresFrictionCoefficient
#define ENGINE_TAG_WHEELS_DIAMETER
EngineParameters engineParameters
void loadDragData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_WHEELS_FRICTION
#define ENGINE_TAG_ENGINE_CYLINDERS
#define ENGINE_TAG_MASS_MASS
std::string vehicleToLoad
#define ENGINE_TAG_SHIFTING_RPM
double x[MAX_POLY_DEGREE]
void loadMassData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_ENGINE_TAU_EX
const EngineParameters & getEngineParameters()
#define ENGINE_TAG_ENGINE_MAXRPM
#define ENGINE_TAG_DRAG_CAIR
void raiseMissingAttributeError(std::string tag, std::string attribute)
#define ENGINE_TAG_ENGINE_POWER
#define ENGINE_TAG_WHEELS
std::vector< double > gearRatios
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
void loadGearData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_VEHICLES
std::string transcode(const XMLCh *const qname)
void computeCoefficients()
VehicleEngineHandler(const std::string &toLoad)
#define ENGINE_TAG_SHIFTING
#define ENGINE_TAG_ENGINE_TAU_BURN
#define ENGINE_TAG_ENGINE
#define ENGINE_TAG_BRAKES
int parseIntAttribute(std::string tag, const char *attribute, const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_DRAG_SECTION
void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
struct PolynomialEngineModelRpmToHp engineMapping
void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_ENGINE_EFFICIENCY
#define ENGINE_TAG_GEAR_DIFFERENTIAL
void loadEngineData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
virtual ~VehicleEngineHandler()
Destructor.
void loadShiftingData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
#define ENGINE_TAG_GEAR_N