44 #ifdef CHECK_MEMORY_LEAKS 46 #endif // CHECK_MEMORY_LEAKS 91 sumoVehicleClassStringInitializer,
SVC_CUSTOM2,
false);
135 sumoVehicleShapeStringInitializer,
SVS_UNKNOWN,
false);
154 if (permissions ==
SVCAll) {
161 std::vector<std::string>
164 const std::vector<std::string> classNames = SumoVehicleClassStrings.
getStrings();
165 std::vector<std::string> result;
166 for (std::vector<std::string>::const_iterator it = classNames.begin(); it != classNames.end(); it++) {
167 const int svc = (int)SumoVehicleClassStrings.
get(*it);
168 if ((svc & permissions) == svc && svc !=
SVC_IGNORING) {
169 result.push_back(*it);
178 if (SumoVehicleClassStrings.
hasString(name)) {
179 return SumoVehicleClassStrings.
get(name);
188 const std::vector<std::string> names = SumoVehicleClassStrings.
getStrings();
189 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
190 if (name.find(*it) != std::string::npos) {
191 ret = ret | (int) SumoVehicleClassStrings.
get(*it);
200 if (allowedS ==
"all") {
206 const std::string s = sta.
next();
207 if (!SumoVehicleClassStrings.
hasString(s)) {
208 WRITE_ERROR(
"Unknown vehicle class '" + s +
"' encountered. It will be ignored.");
211 const std::string& realName = SumoVehicleClassStrings.
getString(vc);
224 if (classes ==
"all") {
238 if (allowedS.size() == 0 && disallowedS.size() == 0) {
240 }
else if (allowedS.size() > 0 && disallowedS.size() > 0) {
241 WRITE_WARNING(
"SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'");
243 }
else if (allowedS.size() > 0) {
254 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
256 const std::string& realName = SumoVehicleClassStrings.
getString(vc);
257 if (realName != *i) {
258 WRITE_WARNING(
"The vehicle class '" + (*i) +
"' is deprecated, use '" + realName +
"' instead.");
268 if (permissions ==
SVCAll) {
270 }
else if (permissions == 0) {
276 if ((mask & permissions) == mask) {
280 if (num_allowed <= (SumoVehicleClassStrings.
size() - num_allowed) && num_allowed > 0) {
291 if (preferred ==
SVCAll || preferred == 0) {
301 if (SumoVehicleShapeStrings.
hasString(name)) {
302 return SumoVehicleShapeStrings.
get(name);
311 return SumoVehicleShapeStrings.
getString(
id);
326 return (permissions &
SVCAll) == 0;
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
std::set< std::string > deprecatedVehicleClassesSeen
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
vehicle is a not electrified rail
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
render as a transport vehicle
const std::string & getString(const T key) const
render as a flexible city bus
vehicle is a small delivery vehicle
std::vector< std::string > getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
render as a delivery vehicle
StringBijection< SUMOVehicleClass >::Entry sumoVehicleClassStringInitializer[]
StringBijection< SUMOVehicleShape >::Entry sumoVehicleShapeStringInitializer[]
render as a sedan passenger vehicle ("Stufenheck")
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permission is a forbidden edge.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
const SVCPermissions SVCAll
std::vector< std::string > getStrings() const
vehicle is a (possibly fast moving) electric rail
#define WRITE_WARNING(msg)
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
vehicle is a large transport vehicle
const int SUMOVehicleClass_MAX
const SUMOReal DEFAULT_VEH_PROB(1.)
render as a hatchback passenger vehicle ("Fliessheck")
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
T get(const std::string &str) const
render as a (city) rail without locomotive
int getVehicleClassCompoundID(const std::string &name)
Returns the OR'ed id of the compound class given by its name.
const SUMOReal DEFAULT_CONTAINER_TRANSHIP_SPEED(5./3.6)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
render as a passenger vehicle
const SUMOReal DEFAULT_PEDESTRIAN_SPEED(5./3.6)
std::string getVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
vehicle is a passenger car (a "normal" car)
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
render as a arbitrary ship
vehicle is a large transport vehicle
render as an emergency vehicle
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
render as a (futuristic) e-vehicle
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
Static storage of an output device and its base (abstract) implementation.
bool hasString(const std::string &str) const
public emergency vehicles
render as a transport vehicle with one trailer
render as a wagon passenger vehicle ("Combi")
const std::string DEFAULT_PEDTYPE_ID("DEFAULT_PEDTYPE")
const std::string DEFAULT_VTYPE_ID("DEFAULT_VEHTYPE")
render as a semi-trailer transport vehicle ("Sattelschlepper")
vehicles ignoring classes
const SVCPermissions SVC_UNSPECIFIED