SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SUMOVehicleClass.h File Reference
#include <config.h>
#include <string>
#include <set>
#include <limits>
#include <utils/common/UtilExceptions.h>
#include <utils/common/StringBijection.h>
#include <utils/xml/SUMOXMLDefinitions.h>

Go to the source code of this file.

Typedefs

typedef int SUMOEmissionClass
typedef int SVCPermissions

Enumerations

enum  SUMOVehicleClass {
  SVC_IGNORING = 0, SVC_PRIVATE = 1, SVC_EMERGENCY = 1 << 1, SVC_AUTHORITY = 1 << 2,
  SVC_ARMY = 1 << 3, SVC_VIP = 1 << 4, SVC_PASSENGER = 1 << 5, SVC_HOV = 1 << 6,
  SVC_TAXI = 1 << 7, SVC_BUS = 1 << 8, SVC_COACH = 1 << 9, SVC_DELIVERY = 1 << 10,
  SVC_TRUCK = 1 << 11, SVC_TRAILER = 1 << 12, SVC_TRAM = 1 << 13, SVC_RAIL_URBAN = 1 << 14,
  SVC_RAIL = 1 << 15, SVC_RAIL_ELECTRIC = 1 << 16, SVC_MOTORCYCLE = 1 << 17, SVC_MOPED = 1 << 18,
  SVC_BICYCLE = 1 << 19, SVC_PEDESTRIAN = 1 << 20, SVC_E_VEHICLE = 1 << 21, SVC_CUSTOM1 = 1 << 22,
  SVC_CUSTOM2 = 1 << 23
}
 Definition of vehicle classes to differ between different lane usage and authority types. More...
enum  SUMOVehicleShape {
  SVS_UNKNOWN, SVS_PEDESTRIAN, SVS_BICYCLE, SVS_MOPED,
  SVS_MOTORCYCLE, SVS_PASSENGER, SVS_PASSENGER_SEDAN, SVS_PASSENGER_HATCHBACK,
  SVS_PASSENGER_WAGON, SVS_PASSENGER_VAN, SVS_DELIVERY, SVS_TRUCK,
  SVS_TRUCK_SEMITRAILER, SVS_TRUCK_1TRAILER, SVS_BUS, SVS_BUS_COACH,
  SVS_BUS_FLEXIBLE, SVS_BUS_TROLLEY, SVS_RAIL, SVS_RAIL_CAR,
  SVS_RAIL_CARGO, SVS_E_VEHICLE, SVS_ANT
}
 Definition of vehicle classes to differ between different appearences. More...

Functions

bool canParseVehicleClasses (const std::string &classes)
 Checks whether the given string contains only known vehicle classes.
int getVehicleClassCompoundID (const std::string &name)
 Returns the OR'ed id of the compound class given by its name.
std::string getVehicleClassCompoundName (int id)
SUMOVehicleClass getVehicleClassID (const std::string &name)
 Returns the class id of the abstract class given by its name.
std::string getVehicleClassNames (SVCPermissions permissions)
 Returns the ids of the given classes, divided using a ' '.
std::vector< std::string > getVehicleClassNamesList (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.
std::string getVehicleShapeName (SUMOVehicleShape id)
 Returns the class name of the shape class given by its id.
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.
SVCPermissions parseVehicleClasses (const std::string &allowedS)
 Parses the given definition of allowed vehicle classes into the given containers Deprecated classes go into a separate container.
SVCPermissions parseVehicleClasses (const std::string &allowedS, const std::string &disallowedS)
 Encodes the given vector of allowed and disallowed classes into a bitset.
SVCPermissions parseVehicleClasses (const std::vector< std::string > &allowedS)
 Encodes the given vector of allowed classs into a bitset Unlike the methods which parse a string it gives immediately a warning output on deprecated vehicle classes.

Variables

const SUMOReal DEFAULT_PEDESTRIAN_SPEED
const SUMOReal DEFAULT_VEH_PROB
const std::string DEFAULT_VTYPE_ID
std::set< std::string > deprecatedVehicleClassesSeen
const int SUMOVehicleClass_MAX
StringBijection< SUMOVehicleClassSumoVehicleClassStrings
StringBijection< SUMOVehicleShapeSumoVehicleShapeStrings
const SVCPermissions SVCAll

Detailed Description

Author
Daniel Krajzewicz
Jakob Erdmann
Michael Behrisch
Walter Bamberger
Date
2006-01-24
Version
Id:
SUMOVehicleClass.h 16290 2014-05-05 12:38:38Z namdre

Definition in file SUMOVehicleClass.h.

Typedef Documentation

Definition at line 202 of file SUMOVehicleClass.h.

Definition at line 193 of file SUMOVehicleClass.h.

Enumeration Type Documentation

Definition of vehicle classes to differ between different lane usage and authority types.

Bits:

  • 0-7: vehicle ownership
  • 8-23: vehicle size

From NavTeq:

  • [0] All
  • [1] Passenger cars
  • [2] High Occupancy Vehicle
  • [3] Emergency Vehicle
  • [4] Taxi
  • [5] Public Bus
  • [6] Delivery Truck
  • [7] Transport Truck
  • [8] Bicycle
  • [9] Pedestrian
Enumerator:
SVC_IGNORING 

vehicles ignoring classes

SVC_PRIVATE 

private vehicles

SVC_EMERGENCY 

public emergency vehicles

SVC_AUTHORITY 

authorities vehicles

SVC_ARMY 

army vehicles

SVC_VIP 

vip vehicles

SVC_PASSENGER 

vehicle is a passenger car (a "normal" car)

SVC_HOV 

vehicle is a HOV

SVC_TAXI 

vehicle is a taxi

SVC_BUS 

vehicle is a bus

SVC_COACH 

vehicle is a coach

SVC_DELIVERY 

vehicle is a small delivery vehicle

SVC_TRUCK 

vehicle is a large transport vehicle

SVC_TRAILER 

vehicle is a large transport vehicle

SVC_TRAM 

vehicle is a light rail

SVC_RAIL_URBAN 

vehicle is a city rail

SVC_RAIL 

vehicle is a not electrified rail

SVC_RAIL_ELECTRIC 

vehicle is a (possibly fast moving) electric rail

SVC_MOTORCYCLE 

vehicle is a motorcycle

SVC_MOPED 

vehicle is a moped

SVC_BICYCLE 

vehicle is a bicycle

SVC_PEDESTRIAN 

is a pedestrian

SVC_E_VEHICLE 

is an electric vehicle

SVC_CUSTOM1 

is a user-defined type

SVC_CUSTOM2 

is a user-defined type

Definition at line 121 of file SUMOVehicleClass.h.

Definition of vehicle classes to differ between different appearences.

Enumerator:
SVS_UNKNOWN 

not defined

SVS_PEDESTRIAN 

render as a pedestrian

SVS_BICYCLE 

render as a bicycle

SVS_MOPED 

render as a moped

SVS_MOTORCYCLE 

render as a motorcycle

SVS_PASSENGER 

render as a passenger vehicle

SVS_PASSENGER_SEDAN 

render as a sedan passenger vehicle ("Stufenheck")

SVS_PASSENGER_HATCHBACK 

render as a hatchback passenger vehicle ("Fliessheck")

SVS_PASSENGER_WAGON 

render as a wagon passenger vehicle ("Combi")

SVS_PASSENGER_VAN 

render as a van

SVS_DELIVERY 

render as a delivery vehicle

SVS_TRUCK 

render as a transport vehicle

SVS_TRUCK_SEMITRAILER 

render as a semi-trailer transport vehicle ("Sattelschlepper")

SVS_TRUCK_1TRAILER 

render as a transport vehicle with one trailer

SVS_BUS 

render as a bus

SVS_BUS_COACH 

render as a coach

SVS_BUS_FLEXIBLE 

render as a flexible city bus

SVS_BUS_TROLLEY 

render as a trolley bus

SVS_RAIL 

render as a rail

SVS_RAIL_CAR 

render as a (city) rail without locomotive

SVS_RAIL_CARGO 

render as a cargo train

SVS_E_VEHICLE 

render as a (futuristic) e-vehicle

SVS_ANT 

render as a giant ant

Definition at line 50 of file SUMOVehicleClass.h.

Function Documentation

bool canParseVehicleClasses ( const std::string &  classes)

Checks whether the given string contains only known vehicle classes.

Definition at line 231 of file SUMOVehicleClass.cpp.

References StringTokenizer::hasNext(), StringTokenizer::next(), and SumoVehicleClassStrings.

int getVehicleClassCompoundID ( const std::string &  name)

Returns the OR'ed id of the compound class given by its name.

Parameters
[in]nameThe name of the abstract vehicle class
Returns
The OR'ed combination of base enum values

Definition at line 198 of file SUMOVehicleClass.cpp.

References SumoVehicleClassStrings, and SVC_IGNORING.

std::string getVehicleClassCompoundName ( int  id)

Definition at line 148 of file SUMOVehicleClass.cpp.

References SumoVehicleClassStrings.

SUMOVehicleClass getVehicleClassID ( const std::string &  name)

Returns the class id of the abstract class given by its name.

Parameters
[in]nameThe name of the abstract vehicle class
Returns
The internal representation of this class. Name must not be a compound name

Definition at line 189 of file SUMOVehicleClass.cpp.

References SumoVehicleClassStrings.

Referenced by SUMOVehicleParserHelper::parseVehicleClass(), parseVehicleClasses(), and TraCIServerAPI_VehicleType::setVariable().

std::string getVehicleClassNames ( SVCPermissions  permissions)

Returns the ids of the given classes, divided using a ' '.

Parameters
[in]thepermissions to encode
Returns
The string representation of these classes

Definition at line 165 of file SUMOVehicleClass.cpp.

References getVehicleClassNamesList(), joinToString(), and SVCAll.

Referenced by GUILane::getParameterWindow(), NWWriter_SUMO::writePermissions(), and NWWriter_SUMO::writePreferences().

std::vector<std::string> getVehicleClassNamesList ( SVCPermissions  permissions)

Returns the ids of the given classes, divided using a ' '.

Parameters
[in]thepermissions to encode
Returns
The string representation of these classes as a vector
Todo:
cache values?

Definition at line 174 of file SUMOVehicleClass.cpp.

References SumoVehicleClassStrings, and SVC_IGNORING.

Referenced by getVehicleClassNames(), and TraCIServerAPI_Lane::processGet().

SUMOVehicleShape getVehicleShapeID ( const std::string &  name)

Returns the class id of the shape class given by its name.

Parameters
[in]nameThe name of the shape class
Returns
The internal representation of this class

Definition at line 275 of file SUMOVehicleClass.cpp.

References SumoVehicleShapeStrings.

Referenced by TraCIServerAPI_VehicleType::setVariable().

std::string getVehicleShapeName ( SUMOVehicleShape  id)

Returns the class name of the shape class given by its id.

Parameters
[in]idThe id of the shape class
Returns
The string representation of this class

Definition at line 285 of file SUMOVehicleClass.cpp.

References SumoVehicleShapeStrings.

Referenced by TraCIServerAPI_VehicleType::getVariable(), and SUMOVTypeParameter::write().

bool isForbidden ( SVCPermissions  permissions)

Returns whether an edge with the given permission is a forbidden edge.

Parameters
[in]permissionsThe permissions of the edge
Returns
Whether the edge is forbidden

Definition at line 295 of file SUMOVehicleClass.cpp.

References SVCAll.

Referenced by NBNode::ApproachingDivider::ApproachingDivider(), NBEdge::divideOnEdges(), NBOwnTLDef::myCompute(), NBOwnTLDef::patchStateForCrossings(), and NBEdge::recheckLanes().

bool isRailway ( SVCPermissions  permissions)

Returns whether an edge with the given permission is a railway edge.

Parameters
[in]permissionsThe permissions of the edge
Returns
Whether the edge is a railway edge

Definition at line 290 of file SUMOVehicleClass.cpp.

References SVC_PASSENGER, SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, and SVC_TRAM.

Referenced by GUILane::drawGL(), GUILane::drawLinkRule(), and NBRampsComputer::fulfillsRampConstraints().

SVCPermissions parseVehicleClasses ( const std::string &  allowedS)

Parses the given definition of allowed vehicle classes into the given containers Deprecated classes go into a separate container.

Parameters
[in]classNamesSpace separated class names
[out]containerThe set of vehicle classes to fill throws ProcessError if parsing fails

Definition at line 211 of file SUMOVehicleClass.cpp.

References deprecatedVehicleClassesSeen, getVehicleClassID(), StringTokenizer::hasNext(), StringTokenizer::next(), SumoVehicleClassStrings, and SVCAll.

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), NBEdgeCont::applyOptions(), NIXMLTypesHandler::myStartElement(), RONetHandler::parseLane(), parseVehicleClasses(), TraCIServerAPI_Edge::processSet(), and TraCIServerAPI_Lane::processSet().

SVCPermissions parseVehicleClasses ( const std::string &  allowedS,
const std::string &  disallowedS 
)

Encodes the given vector of allowed and disallowed classes into a bitset.

Parameters
[in]allowedSDefinition which classes are allowed
[in]disallowedSDefinition which classes are not allowed

Definition at line 245 of file SUMOVehicleClass.cpp.

References parseVehicleClasses(), SVCAll, and WRITE_WARNING.

SVCPermissions parseVehicleClasses ( const std::vector< std::string > &  allowedS)

Encodes the given vector of allowed classs into a bitset Unlike the methods which parse a string it gives immediately a warning output on deprecated vehicle classes.

Parameters
[in]classesSThe names vector to parse

Definition at line 260 of file SUMOVehicleClass.cpp.

References getVehicleClassID(), SumoVehicleClassStrings, and WRITE_WARNING.

Variable Documentation

std::set<std::string> deprecatedVehicleClassesSeen
const int SUMOVehicleClass_MAX

Definition at line 138 of file SUMOVehicleClass.cpp.

Referenced by NWWriter_SUMO::writePermissions().