 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
35 #define EMPREFIX std::string("HBEFA3/")
50 speedFactor(
"normc", 1.0, 0.0, 0.2, 2.0),
53 osgFile(
"car-normal-citrus.obj"),
55 locomotiveLength(-1) {
104 osgFile =
"car-microcargo-citrus.obj";
116 osgFile =
"car-microcargo-citrus.obj";
128 osgFile =
"car-minibus-citrus.obj";
138 osgFile =
"car-minibus-citrus.obj";
267 if (oc.
exists(
"carfollow.model")) {
288 if (oc.
exists(
"default.speeddev")) {
289 const double defaultSpeedDev = oc.
getFloat(
"default.speeddev");
290 if (defaultSpeedDev >= 0) {
315 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000)));
316 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000)));
317 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000)));
318 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000)));
319 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000)));
326 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(6000, 8000)));
327 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(2000, 21000)));
328 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(21000, 2000)));
329 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(14000, 5000)));
330 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(6000, 8000)));
335 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(1000, 1000)));
338 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(10, std::pair< SUMOTime, SUMOTime>(3000, 4000)));
339 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(80, std::pair< SUMOTime, SUMOTime>(1000, 11000)));
340 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(110, std::pair< SUMOTime, SUMOTime>(11000, 2000)));
341 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(170, std::pair< SUMOTime, SUMOTime>(8000, 3000)));
342 myManoeuverAngleTimes.insert(std::pair<
int, std::pair<SUMOTime, SUMOTime>>(181, std::pair< SUMOTime, SUMOTime>(3000, 4000)));
384 if (
impatience == -std::numeric_limits<double>::max()) {
526 if (angle <= angleTime.first) {
527 return (angleTime.second.first);
529 last = angleTime.second.first;
539 if (angle <= angleTime.first) {
540 return (angleTime.second.second);
542 last = angleTime.second.second;
550 std::stringstream stream;
552 stream << std::fixed << std::setprecision(1);
560 std::string triplets = stream.str();
567 for (
const std::string& key : restrictionKeys) {
674 return MAX2(decel, vcDecel);
679 return MAX2(decel, defaultOption);
704 return defaultParams;
const int VTYPEPARS_LATALIGNMENT_SET
std::map< SumoXMLAttr, std::string > SubParams
sub-model parameters
@ SVC_RAIL_FAST
vehicle that is allowed to drive on high-speed rail tracks
void cacheParamRestrictions(const std::vector< std::string > &restrictionKeys)
@ SUMO_ATTR_BOARDING_DURATION
@ SVC_PEDESTRIAN
pedestrian
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SubParams lcParameter
Lane-changing parameter.
double carriageLength
the length of train carriages
@ SVC_E_VEHICLE
is an electric vehicle
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...
SUMOVTypeParameter(const std::string &vtid, const SUMOVehicleClass vc=SVC_IGNORING)
Constructor.
double length
The physical vehicle length.
@ SVC_EMERGENCY
public emergency vehicles
const int VTYPEPARS_MINGAP_SET
@ SVS_MOTORCYCLE
render as a motorcycle
@ SVC_COACH
vehicle is a coach
Static storage of an output device and its base (abstract) implementation.
SUMOTime actionStepLength
The vehicle type's default actionStepLength [ms], i.e. the interval between two control actions....
SUMOEmissionClass emissionClass
The emission class of this vehicle.
@ SVC_CUSTOM2
is a user-defined type
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
const int VTYPEPARS_BOARDING_DURATION
double impatience
The vehicle's impatience (willingness to obstruct others)
@ LATALIGN_CENTER
drive in the middle
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
std::string osgFile
3D model file for this class
const int VTYPEPARS_MINGAP_LAT_SET
bool exists(const std::string &name) const
Returns the information whether the named option is known.
@ SUMO_ATTR_LOADING_DURATION
@ SVS_TRUCK
render as a transport vehicle
@ SUMO_ATTR_COLOR
A color information.
@ SVC_BICYCLE
vehicle is a bicycle
static OptionsCont & getOptions()
Retrieves the options.
@ SVC_DELIVERY
vehicle is a small delivery vehicle
bool saved
Information whether this type was already saved (needed by routers)
const int VTYPEPARS_OSGFILE_SET
double carriageLength
the length of train carriages and locomotive
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL
std::vector< double > & getParameter()
Returns the parameters of this distribution.
@ SUMO_ATTR_CONTAINER_CAPACITY
std::map< int, std::pair< SUMOTime, SUMOTime > > myManoeuverAngleTimes
Map of manoeuver angles versus the times (entry, exit) to execute the manoeuver.
SUMOVehicleShape shape
This class' shape.
const int VTYPEPARS_PROBABILITY_SET
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...
@ SUMO_TAG_VTYPE
description of a vehicle type
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
double length
The physical vehicle length.
@ SUMO_ATTR_LANE_CHANGE_MODEL
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
int containerCapacity
The container capacity of the vehicle.
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_RAIL_URBAN
vehicle is a city rail
const SubParams & getLCParams() const
Returns the LC parameter.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
const int VTYPEPARS_CAR_FOLLOW_MODEL
bool onlyReferenced
Information whether this is a type-stub, being only referenced but not defined (needed by routers)
@ SVC_PRIVATE
private vehicles
static StringBijection< SumoXMLTag > CarFollowModels
car following models
@ SVS_BICYCLE
render as a bicycle
bool wasSet(int what) const
Returns whether the given parameter was set.
int parametersSet
Information for the router which parameter were set.
const int VTYPEPARS_MAXSPEED_LAT_SET
@ SVC_TRAM
vehicle is a light rail
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
@ SVS_DELIVERY
automated car (with cruise controllers)
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
std::string imgFile
Image file for this class.
@ SVC_TRUCK
vehicle is a large transport vehicle
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.
@ SVC_CUSTOM1
is a user-defined type
int containerCapacity
The container capacity of the vehicle.
double height
This class' height.
Structure representing possible vehicle parameter.
const double DEFAULT_PEDESTRIAN_SPEED
SubParams jmParameter
Junction-model parameter.
T get(const std::string &str) const
@ SVC_HOV
vehicle is a HOV
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 ...
SubParams cfParameter
Car-following parameter.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
double maxSpeed
The vehicle type's maximum speed [m/s].
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_RAIL_ELECTRIC
rail vehicle that requires electrified tracks
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 ...
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
std::vector< double > paramRestrictions
cached value of parameters which may restrict access to certain edges
@ SUMO_ATTR_PERSON_CAPACITY
double width
This class' width.
SUMOTime boardingDuration
The time a person needs to board the vehicle.
double minGap
This class' free space in front of the vehicle itself.
double minGap
This class' free space in front of the vehicle itself.
@ SVS_MOPED
render as a moped
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 width
This class' width.
A storage for options typed value containers)
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
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 maxSpeed
The vehicle type's maximum speed [m/s].
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...
int personCapacity
The person capacity of the vehicle.
SUMOVehicleShape shape
This class' shape.
const int VTYPEPARS_SPEEDFACTOR_SET
@ SVC_SHIP
is an arbitrary ship
void write(OutputDevice &dev) const
Writes the vtype.
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
@ SVS_PEDESTRIAN
render as a pedestrian
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
std::string osgFile
3D model file for this class
const int VTYPEPARS_LOADING_DURATION
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
double locomotiveLength
the length of train locomotive
const int VTYPEPARS_CONTAINER_CAPACITY
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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.
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...
@ SVC_MOPED
vehicle is a moped
LateralAlignment latAlignment
The vehicles desired lateral alignment.
@ SUMO_ATTR_CAR_FOLLOW_MODEL
std::string id
The vehicle type's id.
@ SVC_TAXI
vehicle is a taxi
struct for default values that depend of VClass
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT
const int VTYPEPARS_PERSON_CAPACITY
@ SVS_PASSENGER
render as a passenger vehicle
@ SVS_E_VEHICLE
render as a (futuristic) e-vehicle
@ SVS_SHIP
render as a arbitrary ship
const int VTYPEPARS_HEIGHT_SET
int personCapacity
The person capacity of the vehicle.
LaneChangeModel lcModel
The lane-change model to use.
const int VTYPEPARS_IMGFILE_SET
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.
Helper methods for PHEMlight-based emission computation.
@ SVC_TRAILER
vehicle is a large transport vehicle
@ SVC_BUS
vehicle is a bus
@ SUMO_ATTR_ACTIONSTEPLENGTH
void setManoeuverAngleTimes(const SUMOVehicleClass vclass)
Initialise the default mapping between manoeuver angle and times dependant on vehicle class.
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
@ SUMO_ATTR_MANEUVER_ANGLE_TIMES
Class specific timing values for vehicle manoeuvering through angle ranges.
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_MANEUVER_ANGLE_TIMES_SET
@ SVC_MOTORCYCLE
vehicle is a motorcycle
SUMOEmissionClass emissionClass
The emission class of this vehicle.
@ SVS_BUS_COACH
render as a coach
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_SHAPE_SET
double height
This class' height.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const int VTYPEPARS_WIDTH_SET
SUMOVehicleClass vehicleClass
The vehicle's class.
const int VTYPEPARS_IMPATIENCE_SET
const double DEFAULT_VEH_PROB
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.
@ SUMO_ATTR_EMISSIONCLASS
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
const int VTYPEPARS_MAXSPEED_SET
const int VTYPEPARS_VEHICLECLASS_SET
static const SUMOVTypeParameter & getDefault()
return the default parameters, this is a function due to the http://www.parashift....
double minGapLat
The vehicle type's minimum lateral gap [m].
@ SVS_RAIL
render as a rail
std::string getManoeuverAngleTimesS() const
Returns myManoeuverAngleTimes as a string for xml output.
VClassDefaultValues()
default constructor