 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
31 : currentTag(
TAG_VEHICLES), skip(false), currentGear(1) {
46 std::string
getAttributeValue(
const char* attributeName,
const XERCES_CPP_NAMESPACE::Attributes& attrs) {
53 const XMLCh*
const qname,
54 const XERCES_CPP_NAMESPACE::Attributes& attrs) {
163 const XMLCh*
const qname) {
185 for (
int i = 0; i < (int)
gearRatios.size(); i++) {
258 if (mapType !=
"poly") {
259 throw ProcessError(
"Invalid engine map type. Only \"poly\" is supported for now");
270 std::stringstream ss;
271 ss <<
"Invalid gear number " << number <<
". Please check that gears are inserted in order";
290 std::stringstream ss;
291 ss <<
"Maximum degree for the engine polynomial is " <<
MAX_POLY_DEGREE <<
". Please check your model's data";
295 for (
int i = 0; i < (int)attrs.getLength(); i++) {
316 return attrs.getIndex(
transcode(attribute));
320 std::string strValue;
322 if (attributeIndex == -1) {
326 return transcode(attrs.getValue(attributeIndex));
335 std::stringstream ss;
343 std::stringstream ss;
344 ss <<
"Missing attribute \"" << attribute <<
"\" for tag " << tag;
351 std::stringstream ss;
352 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