82 sumoVehicleClassStringInitializer,
SVC_CUSTOM2,
false);
130 sumoVehicleShapeStringInitializer,
SVS_UNKNOWN,
false);
149 if (permissions ==
SVCAll && !expand) {
156 std::vector<std::string>
159 const std::vector<std::string> classNames = SumoVehicleClassStrings.
getStrings();
160 std::vector<std::string> result;
161 for (std::vector<std::string>::const_iterator it = classNames.begin(); it != classNames.end(); it++) {
162 const int svc = (int)SumoVehicleClassStrings.
get(*it);
163 if ((svc & permissions) == svc && svc !=
SVC_IGNORING) {
164 result.push_back(*it);
173 if (SumoVehicleClassStrings.
hasString(name)) {
174 return SumoVehicleClassStrings.
get(name);
183 const std::vector<std::string> names = SumoVehicleClassStrings.
getStrings();
184 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
185 if (name.find(*it) != std::string::npos) {
186 ret = ret | (int) SumoVehicleClassStrings.
get(*it);
195 if (allowedS ==
"all") {
201 const std::string s = sta.
next();
202 if (!SumoVehicleClassStrings.
hasString(s)) {
203 WRITE_ERROR(
"Unknown vehicle class '" + s +
"' encountered.");
206 const std::string& realName = SumoVehicleClassStrings.
getString(vc);
219 if (classes ==
"all") {
233 if (allowedS.size() == 0 && disallowedS.size() == 0) {
235 }
else if (allowedS.size() > 0 && disallowedS.size() > 0) {
236 WRITE_WARNING(
"SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'");
238 }
else if (allowedS.size() > 0) {
247 return SVCAll & ~permissions;
253 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
255 const std::string& realName = SumoVehicleClassStrings.
getString(vc);
256 if (realName != *i) {
257 WRITE_WARNING(
"The vehicle class '" + (*i) +
"' is deprecated, use '" + realName +
"' instead.");
267 if (permissions ==
SVCAll) {
269 }
else if (permissions == 0) {
275 if ((mask & permissions) == mask) {
279 if (num_allowed <= (SumoVehicleClassStrings.
size() - num_allowed) && num_allowed > 0) {
290 if (preferred ==
SVCAll || preferred == 0) {
300 if (SumoVehicleShapeStrings.
hasString(name)) {
301 return SumoVehicleShapeStrings.
get(name);
309 return SumoVehicleShapeStrings.
hasString(shape);
315 return SumoVehicleShapeStrings.
getString(
id);
330 return (permissions &
SVCAll) == 0;
345 WRITE_ERROR(
"Simultaneous specification of vClasses and exceptions is not allowed!");
347 return std::map<SVCPermissions, double>();
361 std::map<SVCPermissions, double> offsets;
362 offsets[vClassBitset] = value;
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
std::string getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
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)
const double DEFAULT_VEH_PROB(1.)
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
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
vehicle is a small delivery vehicle
std::vector< std::string > getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
const std::string DEFAULT_BIKETYPE_ID("DEFAULT_BIKETYPE")
std::map< SVCPermissions, double > parseStopOffsets(const SUMOSAXAttributes &attrs, bool &ok)
Extract stopOffsets from attributes of stopOffset element.
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
all VClasses are allowed
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
std::vector< std::string > getStrings() const
vehicle is a (possibly fast moving) electric rail
#define WRITE_WARNING(msg)
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
vehicle is a large transport vehicle
const double DEFAULT_PEDESTRIAN_SPEED(5./3.6)
bool canParseVehicleShape(const std::string &shape)
Checks whether the given string contains only known vehicle shape.
const int SUMOVehicleClass_MAX
const double DEFAULT_CONTAINER_TRANSHIP_SPEED(5./3.6)
render as a hatchback passenger vehicle ("Fliessheck")
Encapsulated SAX-Attributes.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
classes which drive on tracks
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.
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
vehicle is a passenger car (a "normal" car)
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
render as a arbitrary ship
bool noVehicles(SVCPermissions permissions)
Returns whether an edge with the given permission forbids vehicles.
vehicle is a large transport vehicle
render as an emergency vehicle
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
bool isSidewalk(SVCPermissions permissions)
Returns whether an edge with the given permission is a sidewalk.
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")
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
vehicles ignoring classes
const SVCPermissions SVC_UNSPECIFIED
permissions not specified