43 #ifdef CHECK_MEMORY_LEAKS
45 #endif // CHECK_MEMORY_LEAKS
235 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
240 if (ret.length() > 0) {
241 return ret.substr(1);
254 std::vector<std::string>
258 std::vector<std::string> result;
259 for (std::vector<std::string>::const_iterator it = classNames.begin(); it != classNames.end(); it++) {
261 if ((svc & permissions) == svc && svc !=
SVC_UNKNOWN) {
262 result.push_back(*it);
269 std::pair<std::string, bool>
273 return std::pair<std::string, bool>(
"",
false);
277 size_t num_allowed = 0;
279 if ((mask & permissions) == mask) {
296 throw ProcessError(
"Unknown vehicle class '" + name +
"'.");
304 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
305 if (name.find(*it) != std::string::npos) {
337 if (allowedS.size() == 0 && disallowedS.size() == 0) {
339 }
else if (allowedS.size() > 0 && disallowedS.size() > 0) {
340 WRITE_WARNING(
"SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'");
342 }
else if (allowedS.size() > 0) {
353 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
365 throw ProcessError(
"Unknown vehicle shape '" + name +
"'.");
378 return (permissions & anyRail) > 0 && (permissions &
SVC_PASSENGER) == 0;
387 throw ProcessError(
"Unknown emission type '" + name +
"'.");
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
const LaneChangeModel DEFAULT_VEH_LANE_CHANGE_MODEL
SUMOEmissionClass getVehicleEmissionTypeID(const std::string &name)
Returns the class id of the emission class given by its name.
std::string getVehicleClassCompoundName(int id)
const SUMOReal DEFAULT_VEH_TMP5
SumoXMLTag
Numbers representing SUMO-XML - element names.
std::string getVehicleEmissionTypeName(SUMOEmissionClass id)
Returns the class name of the emission class given by its id.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
render as a slow (passenger) train
vehicle is a large transport vehicle
vehicle is a small delivery vehicle
std::string getAllowedVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
const SUMOVehicleShape DEFAULT_VEH_SHAPE
render as a fast (passenger) train
const SUMOReal DEFAULT_VEH_PROB
render as a delivery vehicle
const SumoXMLTag DEFAULT_VEH_FOLLOW_MODEL
StringBijection< SUMOVehicleClass >::Entry sumoVehicleClassStringInitializer[]
StringBijection< SUMOVehicleShape >::Entry sumoVehicleShapeStringInitializer[]
const SUMOReal DEFAULT_VEH_LENGTH
render as a sedan passenger vehicle ("Stufenheck")
const SUMOReal DEFAULT_VEH_SIGMA
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
const std::string DEFAULT_VTYPE_ID
#define WRITE_WARNING(msg)
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
render as a semi-trailer transport vehicle ("Sattelschlepper")
SUMOEmissionClass
Definition of vehicle emission classes.
const SUMOReal DEFAULT_PERSON_SPEED
const int SUMOVehicleClass_MAX
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2)
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN)
render as a hatchback passenger vehicle ("Fliessheck")
StringBijection< SUMOEmissionClass > SumoEmissionClassStrings(SumoEmissionClassStringInitializer, SVE_P_LDV_A0_14_14)
StringBijection< SUMOEmissionClass >::Entry SumoEmissionClassStringInitializer[]
std::pair< std::string, bool > getPermissionEncoding(SVCPermissions permissions)
returns the shorter encoding of the given permissions (selects automatically wether to use allow or d...
const SUMOReal DEFAULT_VEH_TAU
const SUMOReal DEFAULT_VEH_MAXSPEED
int getVehicleClassCompoundID(const std::string &name)
Returns the OR'ed id of the compound class given by its name.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers. ...
const SUMOReal DEFAULT_VEH_TMP3
render as a passenger vehicle
const SUMOReal DEFAULT_VEH_SPEEDDEV
const SVCPermissions SVCFreeForAll
vehicle is a passenger car (a "normal" car)
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
render as a flexible city bus
const SUMOReal DEFAULT_VEH_MINGAP
public emergency vehicles
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
vehicle is a slow moving transport rail
const SUMOReal DEFAULT_VEH_WIDTH
render as a transport vehicle with one trailer
const SUMOReal DEFAULT_VEH_TMP2
const SUMOReal DEFAULT_VEH_HEIGHT
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
render as a (futuristic) e-vehicle
const SUMOReal DEFAULT_VEH_SPEEDFACTOR
const SUMOReal DEFAULT_VEH_ACCEL
std::vector< std::string > getAllowedVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
const SUMOReal DEFAULT_VEH_TMP1
public transport vehicles
const SUMOReal DEFAULT_VEH_TMP4
const SUMOVehicleClass DEFAULT_VEH_CLASS
render as a wagon passenger vehicle ("Combi")
const SUMOReal DEFAULT_VEH_DECEL
vehicle is a fast moving rail
vehicles ignoring classes
render as a transport vehicle