 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
170 if (permissions ==
SVCAll && !expand) {
181 const std::vector<std::string>&
186 std::vector<std::string> result;
187 for (std::vector<std::string>::const_iterator it = classNames.begin(); it != classNames.end(); it++) {
189 if ((svc & permissions) == svc && svc !=
SVC_IGNORING) {
190 result.push_back(*it);
213 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
214 if (name.find(*it) != std::string::npos) {
224 if (allowedS ==
"all") {
232 const std::string s = sta.
next();
234 WRITE_ERROR(
"Unknown vehicle class '" + s +
"' encountered.");
253 if (classes ==
"all") {
272 if (allowedS.size() == 0 && disallowedS.size() == 0) {
274 }
else if (allowedS.size() > 0 && disallowedS.size() > 0) {
275 WRITE_WARNING(
"SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'");
277 }
else if (allowedS.size() > 0) {
287 return SVCAll & ~permissions;
294 if (std::find(allowedS.begin(), allowedS.end(),
"all") != allowedS.end()) {
297 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
300 if (realName != *i) {
301 WRITE_WARNING(
"The vehicle class '" + (*i) +
"' is deprecated, use '" + realName +
"' instead.");
311 if (permissions ==
SVCAll) {
313 }
else if (permissions == 0) {
319 if ((mask & permissions) == mask) {
334 if (preferred ==
SVCAll || preferred == 0) {
377 return (permissions &
SVCAll) == 0;
397 WRITE_ERROR(
"Simultaneous specification of vClasses and exceptions is not allowed!");
399 return std::map<SVCPermissions, double>();
413 std::map<SVCPermissions, double> offsets;
414 offsets[vClassBitset] = value;
vehicle that is allowed to drive on high-speed rail tracks
int getVehicleClassCompoundID(const std::string &name)
Returns the OR'ed id of the compound class given by its name.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
static std::map< std::string, SVCPermissions > parseVehicleClassesCached
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
const std::vector< std::string > & getVehicleClassNamesList(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
public emergency vehicles
const int SUMOVehicleClass_MAX
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
#define WRITE_WARNING(msg)
Static storage of an output device and its base (abstract) implementation.
bool hasNext()
returns the information whether further substrings exist
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
const std::string DEFAULT_PEDTYPE_ID("DEFAULT_PEDTYPE")
const double DEFAULT_PEDESTRIAN_SPEED(5./3.6)
render as a transport vehicle
vehicle is a small delivery vehicle
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static std::map< SVCPermissions, std::string > getVehicleClassNamesCached
const std::string DEFAULT_BIKETYPE_ID("DEFAULT_BIKETYPE")
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
vehicle is a not electrified rail
const double DEFAULT_CONTAINER_TRANSHIP_SPEED(5./3.6)
render as a flexible city bus
render as a sedan passenger vehicle ("Stufenheck")
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
static std::string vehicleClassNameAll
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
StringBijection< SUMOVehicleShape >::Entry sumoVehicleShapeStringInitializer[]
automated car (with cruise controllers)
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
bool isForbidden(SVCPermissions permissions)
Returns whether an edge with the given permission is a forbidden edge.
vehicle is a large transport vehicle
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
classes which drive on tracks
bool canParseVehicleShape(const std::string &shape)
Checks whether the given string contains only known vehicle shape.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
vehicle is a passenger car (a "normal" car)
rail vehicle that requires electrified tracks
render as a hatchback passenger vehicle ("Fliessheck")
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
static std::map< int, std::vector< std::string > > vehicleClassNamesListCached
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.
render as a (city) rail without locomotive
StringBijection< SUMOVehicleShape > SumoVehicleShapeStrings(sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false)
std::set< std::string > deprecatedVehicleClassesSeen
StringBijection< SUMOVehicleClass >::Entry sumoVehicleClassStringInitializer[]
const SVCPermissions SVCAll
all VClasses are allowed
const std::string DEFAULT_VTYPE_ID("DEFAULT_VEHTYPE")
render as a passenger vehicle
const double DEFAULT_VEH_PROB(1.)
render as an emergency vehicle
render as a (futuristic) e-vehicle
render as a arbitrary ship
std::map< SVCPermissions, double > parseStopOffsets(const SUMOSAXAttributes &attrs, bool &ok)
Extract stopOffsets from attributes of stopOffset element.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
render as a semi-trailer transport vehicle ("Sattelschlepper")
bool noVehicles(SVCPermissions permissions)
Returns whether an edge with the given permission forbids vehicles.
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
vehicle is a large transport vehicle
render as a transport vehicle with one trailer
render as a wagon passenger vehicle ("Combi")
bool isSidewalk(SVCPermissions permissions)
Returns whether an edge with the given permission is a sidewalk.
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
vehicles ignoring classes
Encapsulated SAX-Attributes.