36#define EMPREFIX std::string("HBEFA4/")
37#define TTT_UNSET SUMOTime_MIN
80 osgFile(
"car-normal-citrus.obj"),
165 osgFile =
"car-microcargo-citrus.obj";
177 osgFile =
"car-microcargo-citrus.obj";
180 emissionClass = PollutantsInterface::getClassByName(
EMPREFIX +
"TT_AT_gt34-40t_Euro-VI_A-C", vclass);
189 osgFile =
"car-minibus-citrus.obj";
193 emissionClass = PollutantsInterface::getClassByName(
EMPREFIX +
"UBus_Std_gt15-18t_Euro-VI_A-C", vclass);
201 osgFile =
"car-minibus-citrus.obj";
203 emissionClass = PollutantsInterface::getClassByName(
EMPREFIX +
"Coach_3-Axes_gt18t_Euro-VI_A-C", vclass);
236 emissionClass = PollutantsInterface::getClassByName(
"HBEFA3/HDV_D_EU0", vclass);
264 emissionClass = PollutantsInterface::getClassByName(
EMPREFIX +
"LCV_diesel_N1-III_Euro-6ab", vclass);
273 emissionClass = PollutantsInterface::getClassByName(
EMPREFIX +
"LCV_diesel_N1-III_Euro-6ab", vclass);
313 emissionClass = PollutantsInterface::getClassByName(
"HBEFA3/HDV_D_EU0", vclass);
343 osgFile(
"car-normal-citrus.obj"),
366 if (oc.
exists(
"carfollow.model")) {
392 if (oc.
exists(
"default.speeddev")) {
393 const double defaultSpeedDev = oc.
getFloat(
"default.speeddev");
394 if (defaultSpeedDev >= 0) {
419 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000)));
420 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000)));
421 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000)));
422 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000)));
423 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000)));
430 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(6000, 8000)));
431 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(2000, 21000)));
432 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(21000, 2000)));
433 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(14000, 5000)));
434 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(6000, 8000)));
439 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(1000, 1000)));
442 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000)));
443 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000)));
444 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000)));
445 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000)));
446 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000)));
494 if (
impatience == -std::numeric_limits<double>::max()) {
587 dev.
writeAttr(lcParam.first, lcParam.second);
591 dev.
writeAttr(jmParam.first, jmParam.second);
598 dev.
writeAttr(cfParam.first, cfParam.second);
657 std::vector<double> result;
659 if (!values.empty()) {
674 if (valueTable.size() == 1) {
675 throw ProcessError(
TLF(
"Invalid size of % table for vType '%' (at least 2 values are required).",
toString(attr),
id));
676 }
else if (speedTable.size() != valueTable.size()) {
677 throw ProcessError(
TLF(
"Mismatching size of speedTable (%) and % table (%) for vType '%'.", speedTable.size(),
toString(attr), valueTable.size(),
id));
680 for (
int i = 0; i < (int)speedTable.size(); i++) {
681 result[speedTable[i]] = valueTable[i];
685 return defaultProfile;
739 if (angle <= angleTime.first) {
740 return (angleTime.second.first);
742 last = angleTime.second.first;
752 if (angle <= angleTime.first) {
753 return (angleTime.second.second);
755 last = angleTime.second.second;
763 std::stringstream stream;
765 stream << std::fixed << std::setprecision(1);
773 std::string triplets = stream.str();
780 for (
const std::string& key : restrictionKeys) {
900 for (
const std::string& f : rawFiles) {
1014 return MAX2(decel, vcDecel);
1019 return MAX2(decel, defaultOption);
1043 return defaultParams;
1051 if (val ==
"right") {
1053 }
else if (val ==
"center") {
1055 }
else if (val ==
"arbitrary") {
1057 }
else if (val ==
"nice") {
1059 }
else if (val ==
"compact") {
1061 }
else if (val ==
"left") {
1088 std::vector<std::pair<double, double> > MaxAccelProfile;
const std::string invalid_return< std::string >::value
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
const long long int VTYPEPARS_TTT_SET
const long long int VTYPEPARS_SHAPE_SET
const long long int VTYPEPARS_LOADING_DURATION
const long long int VTYPEPARS_TTT_BIDI_SET
const long long int VTYPEPARS_SCALE_SET
const long long int VTYPEPARS_PERSON_CAPACITY
const long long int VTYPEPARS_CAR_FOLLOW_MODEL
const long long int VTYPEPARS_FRONT_SEAT_POS_SET
const long long int VTYPEPARS_WIDTH_SET
const long long int VTYPEPARS_CARRIAGE_LENGTH_SET
const long long int VTYPEPARS_ACTIONSTEPLENGTH_SET
const long long int VTYPEPARS_MAXSPEED_LAT_SET
const long long int VTYPEPARS_MAXSPEED_SET
const long long int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT
const long long int VTYPEPARS_LATALIGNMENT_SET
const long long int VTYPEPARS_COLOR_SET
const long long int VTYPEPARS_LANE_CHANGE_MODEL_SET
const long long int VTYPEPARS_DESIRED_MAXSPEED_SET
const long long int VTYPEPARS_OSGFILE_SET
const long long int VTYPEPARS_MANEUVER_ANGLE_TIMES_SET
const long long int VTYPEPARS_SPEEDFACTOR_PREMATURE_SET
const long long int VTYPEPARS_SPEEDFACTOR_SET
const long long int VTYPEPARS_CARRIAGE_GAP_SET
const long long int VTYPEPARS_MINGAP_SET
const long long int VTYPEPARS_PROBABILITY_SET
const long long int VTYPEPARS_HEIGHT_SET
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL
const long long int VTYPEPARS_MASS_SET
const long long int VTYPEPARS_BOARDING_DURATION
LatAlignmentDefinition
Possible ways to choose the lateral alignment, i.e., how vehicles align themselves within their lane.
@ RIGHT
drive on the right side
@ GIVEN
The alignment as offset is given.
@ DEFAULT
No information given; use default.
@ LEFT
drive on the left side
@ ARBITRARY
maintain the current alignment
@ NICE
align with the closest sublane border
@ COMPACT
align with the rightmost sublane that allows keeping the current speed
@ CENTER
drive in the middle
const long long int VTYPEPARS_BOARDING_FACTOR_SET
const long long int VTYPEPARS_VEHICLECLASS_SET
const long long int VTYPEPARS_IMPATIENCE_SET
const long long int VTYPEPARS_LENGTH_SET
const long long int VTYPEPARS_SEATING_WIDTH_SET
const long long int VTYPEPARS_IMGFILE_SET
const long long int VTYPEPARS_CONTAINER_CAPACITY
const long long int VTYPEPARS_MINGAP_LAT_SET
const long long int VTYPEPARS_CARRIAGE_DOORS_SET
const long long int VTYPEPARS_LOCOMOTIVE_LENGTH_SET
double getDefaultVehicleLength(const SUMOVehicleClass vc)
Returns the default vehicle length This put into a function so it can be used by NBVehicle.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
const double DEFAULT_VEH_HEIGHT
const double DEFAULT_VEH_PROB
const double DEFAULT_VEH_MASS
SUMOVehicleShape
Definition of vehicle classes to differ between different appearances.
@ RAIL_CARGO
render as a cargo train
@ PASSENGER
render as a passenger vehicle
@ SCOOTER
render as a scooter
@ RAIL_CAR
render as a (city) rail without locomotive
@ SHIP
render as a arbitrary ship
@ DELIVERY
render as a delivery vehicle
@ BICYCLE
render as a bicycle
@ MOTORCYCLE
render as a motorcycle
@ BUS_TROLLEY
render as a trolley bus
@ TAXI
automated car (with cruise controllers)
@ E_VEHICLE
render as a (futuristic) e-vehicle
@ TRUCK
render as a transport vehicle
@ AIRCRAFT
render as aircraft
@ BUS_FLEXIBLE
render as a flexible city bus
@ TRUCK_1TRAILER
render as a transport vehicle with one trailer
@ BUS_COACH
render as a coach
@ TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ PEDESTRIAN
render as a pedestrian
const double DEFAULT_PEDESTRIAN_SPEED
const double DEFAULT_BICYCLE_SPEED
const double DEFAULT_VEH_WIDTH
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_SHIP
is an arbitrary ship
@ SVC_PRIVATE
private vehicles
@ SVC_HOV
vehicle is a HOV
@ SVC_TRUCK
vehicle is a large transport vehicle
@ SVC_CUSTOM2
is a user-defined type
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_COACH
vehicle is a coach
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_RAIL_FAST
vehicle that is allowed to drive on high-speed rail tracks
@ SVC_TRAILER
vehicle is a large transport vehicle
@ SVC_CUSTOM1
is a user-defined type
@ SVC_RAIL_ELECTRIC
rail vehicle that requires electrified tracks
@ SVC_DELIVERY
vehicle is a small delivery vehicle
@ SVC_RAIL_URBAN
vehicle is a city rail
@ SVC_MOTORCYCLE
vehicle is a motorcycle
@ SVC_EMERGENCY
public emergency vehicles
@ SVC_MOPED
vehicle is a moped
@ SVC_TRAM
vehicle is a light rail
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
@ SVC_E_VEHICLE
is an electric vehicle
@ SVC_PEDESTRIAN
pedestrian
@ CENTER
At the center of the lane.
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_PARAM
parameter associated to a certain key
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_JM_STOPLINE_GAP_MINOR
@ SUMO_ATTR_EMISSIONCLASS
@ SUMO_ATTR_JM_IGNORE_FOE_SPEED
@ SUMO_ATTR_JM_STOPSIGN_WAIT
@ SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME
@ SUMO_ATTR_LANE_CHANGE_MODEL
@ SUMO_ATTR_JM_STOPLINE_GAP
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
@ SUMO_ATTR_JM_ALLWAYSTOP_WAIT
@ SUMO_ATTR_LOADING_DURATION
@ SUMO_ATTR_MANEUVER_ANGLE_TIMES
Class specific timing values for vehicle maneuvering through angle ranges.
@ SUMO_ATTR_TIME_TO_TELEPORT_BIDI
@ SUMO_ATTR_CAR_FOLLOW_MODEL
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
@ SUMO_ATTR_DESIRED_MAXSPEED
@ SUMO_ATTR_JM_IGNORE_FOE_PROB
@ SUMO_ATTR_CARRIAGE_DOORS
@ SUMO_ATTR_CONTAINER_CAPACITY
@ SUMO_ATTR_BOARDING_FACTOR
@ SUMO_ATTR_JM_CROSSING_GAP
@ SUMO_ATTR_CARRIAGE_LENGTH
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_JM_SIGMA_MINOR
@ SUMO_ATTR_TIME_TO_TELEPORT
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_SPEEDFACTOR_PREMATURE
@ SUMO_ATTR_JM_IGNORE_JUNCTION_FOE_PROB
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_LOCOMOTIVE_LENGTH
@ SUMO_ATTR_JM_DRIVE_RED_SPEED
@ SUMO_ATTR_JM_TIMEGAP_MINOR
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static std::string checkForRelativity(const std::string &filename, const std::string &basePath)
Returns the path from a configuration so that it is accessible from the current working directory.
std::map< double, double > LinearApproxMap
A storage for options typed value containers).
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float).
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String).
bool exists(const std::string &name) const
Returns the information whether the named option is known.
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
bool hasParameter(const std::string &key) const
Returns whether the parameter is set.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
Helper methods for PHEMlight-based emission computation.
Structure representing possible vehicle parameter.
double locomotiveLength
the length of the locomotive
SUMOTime getExitManoeuvreTime(const int angle) const
Returns the time that will be needed for the vehicle type to execute the (exit) manoeuvre (and be blo...
double scaleVisual
the scaling factor when drawing the object
double width
This class' width.
SubParams cfParameter
Car-following parameter.
void write(OutputDevice &dev) const
Writes the vtype.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
SUMOTime actionStepLength
The vehicle type's default actionStepLength [ms], i.e. the interval between two control actions....
void cacheParamRestrictions(const std::vector< std::string > &restrictionKeys)
bool saved
Information whether this type was already saved (needed by routers).
std::vector< double > getCFValueTable(SumoXMLAttr attr) const
retrieve value table from cfParameter
SUMOTime getTimeToTeleport(SUMOTime defaultValue) const
return time-to-teleport (either custom or default)
bool wasSet(long long int what) const
Returns whether the given parameter was set.
double height
This class' height.
static LinearApproxHelpers::LinearApproxMap getDefaultDesAccelProfile(const SUMOVehicleClass vc, double desAccel)
Returns the default desired acceleration profile for the given vehicle class This needs to be a funct...
double desiredMaxSpeed
The vehicle type's desired maximum speed [m/s].
SUMOEmissionClass emissionClass
The emission class of this vehicle.
double frontSeatPos
the offset of the first person seat from the front of the vehicle
double latAlignmentOffset
(optional) The vehicle's desired lateral alignment as offset in m from center line
std::string getJMParamString(const SumoXMLAttr attr, const std::string defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
double carriageLength
the length of train carriages
static std::set< SumoXMLAttr > AllowedJMAttrs
allowed attrs for the junction model
double seatingWidth
width to be used when comping seats
SUMOTime getTimeToTeleportBidi(SUMOTime defaultValue) const
return time-to-teleport.bidi (either custom or default)
double length
The physical vehicle length.
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
std::vector< std::string > carriageImages
Image files for additional carriages.
double speedFactorPremature
the possible speed reduction when a train is ahead of schedule
std::vector< double > paramRestrictions
cached value of parameters which may restrict access to certain edges
static double getDefaultDecel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default deceleration for the given vehicle class This needs to be a function because the ...
SUMOTime getEntryManoeuvreTime(const int angle) const
Returns the time that will be needed for the vehicle type to execute the (entry) manoeuvre (and be bl...
void initRailVisualizationParameters(const std::string fileName="")
init Rail Visualization Parameters
long long int parametersSet
Information for the router which parameter were set.
double minGap
This class' free space in front of the vehicle itself.
double maxPlatformDistance
the maximum distance between platform and train
std::map< SumoXMLAttr, std::string > SubParams
sub-model parameters
std::string imgFile
Image file for this class.
SUMOVehicleShape shape
This class' shape.
int personCapacity
The person capacity of the vehicle.
int carriageDoors
the number of doors per carriage
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
bool onlyReferenced
Information whether this is a type-stub, being only referenced but not defined (needed by routers).
LinearApproxHelpers::LinearApproxMap getCFProfile(const SumoXMLAttr attr, const LinearApproxHelpers::LinearApproxMap &defaultProfile) const
Returns the named value from the map, or the default if it is not contained there.
double scale
individual scaling factor (-1 for undefined)
double getLCParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
SUMOTime timeToTeleport
the custom time-to-teleport for this type
std::string osgFile
3D model file for this class
double maxSpeed
The vehicle type's (technical) maximum speed [m/s].
static double getDefaultEmergencyDecel(const SUMOVehicleClass vc, double decel, double defaultOption)
Returns the default emergency deceleration for the given vehicle class This needs to be a function be...
SUMOTime timeToTeleportBidi
the custom time-to-teleport.bidi for this type
void setManoeuverAngleTimes(const SUMOVehicleClass vclass)
Initialise the default mapping between manoeuver angle and times dependant on vehicle class.
double carriageGap
the length of the gap between carriages
int containerCapacity
The container capacity of the vehicle.
static const SUMOVTypeParameter & getDefault()
return the default parameters, this is a function due to the http://www.parashift....
SUMOTime boardingDuration
The time a person needs to board the vehicle.
static LinearApproxHelpers::LinearApproxMap getDefaultMaxAccelProfile(const SUMOVehicleClass vc, double maxAccel)
Returns the default maximum acceleration profile for the given vehicle class This needs to be a funct...
double getCFParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
double minGapLat
The vehicle type's minimum lateral gap [m].
double boardingFactor
factor for boardingDuration / loadingDuration
SUMOVehicleClass vehicleClass
The vehicle's class.
SUMOVTypeParameter(const std::string &vtid, const SUMOVehicleClass vc=SVC_IGNORING)
Constructor.
double getJMParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
std::string getCFParamString(const SumoXMLAttr attr, const std::string defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
std::string id
The vehicle type's id.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
const SubParams & getLCParams() const
Returns the LC parameter.
std::string getLCParamString(const SumoXMLAttr attr, const std::string &defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
SubParams lcParameter
Lane-changing parameter.
LatAlignmentDefinition latAlignmentProcedure
Information on how the vehicle shall choose the lateral alignment.
static double getDefaultImperfection(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle c...
double carriageDoorWidth
the width of the carriage doors
SubParams jmParameter
Junction-model parameter.
double impatience
The vehicle's impatience (willingness to obstruct others).
std::string getManoeuverAngleTimesS() const
Returns myManoeuverAngleTimes as a string for xml output.
std::map< int, std::pair< SUMOTime, SUMOTime > > myManoeuverAngleTimes
Map of manoeuver angles versus the times (entry, exit) to execute the manoeuver.
LaneChangeModel lcModel
The lane-change model to use.
static bool parseLatAlignment(const std::string &val, double &lao, LatAlignmentDefinition &lad)
Parses and validates a given latAlignment value.
static double getDefaultAccel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default acceleration for the given vehicle class This needs to be a function because the ...
static StringBijection< SumoXMLTag > CarFollowModels
car following models
std::vector< std::string > getVector()
return vector of strings
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
#define UNUSED_PARAMETER(x)
struct for default values that depend of VClass
double height
This class' height.
int carriageDoors
the number of doors per carriage
int personCapacity
The person capacity of the vehicle.
double mass
This class' mass.
double maxPlatformDistance
the maximum distance between platform and train
double carriageLength
the length of train carriages
double desiredMaxSpeed
The vehicle type's desired maximum speed [m/s].
std::string osgFile
3D model file for this class
SUMOEmissionClass emissionClass
The emission class of this vehicle.
double minGap
This class' free space in front of the vehicle itself.
int containerCapacity
The container capacity of the vehicle.
double maxSpeed
The vehicle type's maximum speed [m/s] (technical limit, not subject to speed deviation).
double carriageDoorWidth
the width of the carriage doors
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
double width
This class' width.
VClassDefaultValues()
default constructor
double length
The physical vehicle length.
SUMOVehicleShape shape
This class' shape.
double minGapLat
The vehicle type's minimum lateral gap [m].
LatAlignmentDefinition latAlignmentProcedure
the lateral alignment procedure
double locomotiveLength
the length of train locomotive