35 {}, {}, {}, {}, {}, {}, {}, {}),
37 myDefaultVehicleType(
true),
38 myDefaultVehicleTypeModified(
false) {
40 vehicleClass = defaultVClass;
43 initRailVisualizationParameters();
49 {}, {}, {}, {}, {}, {}, {}, {}),
51 myDefaultVehicleType(
false),
52 myDefaultVehicleTypeModified(
false) {
59 initRailVisualizationParameters();
65 {}, {}, {}, {}, {}, {}, {}, {}),
67 myDefaultVehicleType(
false),
68 myDefaultVehicleTypeModified(
false) {
72 initRailVisualizationParameters();
164 return Boundary(-0.1, -0.1, 0.1, 0.1);
456 return defaultValues.
length;
462 return defaultValues.
minGap;
468 return defaultValues.
width;
474 return defaultValues.
height;
587 undoList->
p_add(vTypeChangeAttributeForced);
592 undoList->
p_add(vTypeChangeAttributeForced);
598 undoList->
p_add(vTypeChangeAttributeForced);
624 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
646 return canParse<double>(value);
652 return canParse<double>(value) && (parse<double>(value) >= 0);
654 return canParse<double>(value) && (parse<double>(value) >= -1);
656 return canParse<double>(value) && (parse<double>(value) >= -1);
658 return canParse<double>(value) && (parse<double>(value) >= -1);
660 return canParse<double>(value) && (parse<double>(value) >= 0);
662 return canParse<double>(value) && (parse<double>(value) >= 0);
664 return canParse<double>(value) && (parse<double>(value) >= 0);
666 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
668 return canParse<double>(value) && (parse<double>(value) >= 0);
670 return canParse<double>(value) && (parse<double>(value) >= 0);
679 return canParse<double>(value);
686 return canParse<double>(value) && (parse<double>(value) >= 0);
692 return canParse<double>(value) && (parse<double>(value) > 0);
698 return canParse<double>(value) && (parse<double>(value) > 0);
700 return canParse<double>(value) && (parse<double>(value) >= 0);
702 return canParse<double>(value) && (parse<double>(value) >= 0);
704 return canParse<double>(value) && (parse<double>(value) >= 0);
706 return canParse<double>(value) && (parse<double>(value) >= 0);
711 return canParse<RGBColor>(value);
724 if (value ==
"all") {
730 return canParse<double>(value);
732 return canParse<double>(value);
740 return canParse<int>(value);
742 return canParse<int>(value);
744 return canParse<double>(value);
746 return canParse<double>(value);
750 return canParse<double>(value);
752 return canParse<double>(value);
754 return canParse<double>(value) && (parse<double>(value) >= 0);
756 return canParse<double>(value) && (parse<double>(value) >= 0);
760 return canParse<double>(value) && (parse<double>(value) >= -1);
762 return canParse<double>(value) && (parse<double>(value) >= -1);
764 return canParse<double>(value) && (parse<double>(value) >= 0);
769 return canParse<bool>(value);
840 const std::map<std::string, std::string>&
1089 std::string parametersStr;
1092 parametersStr += i.first +
"=" + i.second +
"|";
1095 if (!parametersStr.empty()) {
1096 parametersStr.pop_back();
1191 if (value.empty()) {
1211 if (value.empty()) {
1251 if (value.empty()) {
1264 if (value.empty() || (canParse<double>(value) && (parse<double>(value) == 0))) {
1275 if (!value.empty() && (value !=
toString(defaultValues.
length))) {
1276 length = parse<double>(value);
1287 if (!value.empty() && (value !=
toString(defaultValues.
minGap))) {
1288 minGap = parse<double>(value);
1336 color = parse<RGBColor>(value);
1371 if (!value.empty() && (value !=
toString(defaultValues.
shape))) {
1383 if (!value.empty() && (value !=
toString(defaultValues.
width))) {
1384 width = parse<double>(value);
1395 if (!value.empty() && (value !=
toString(defaultValues.
height))) {
1396 height = parse<double>(value);
1551 if (!value.empty() && (value != defaultValues.
osgFile)) {
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
const int VTYPEPARS_MAXSPEED_SET
const int VTYPEPARS_PERSON_CAPACITY
const int VTYPEPARS_HEIGHT_SET
const int VTYPEPARS_VEHICLECLASS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_SPEEDFACTOR_SET
const int VTYPEPARS_BOARDING_DURATION
const int VTYPEPARS_IMPATIENCE_SET
const int VTYPEPARS_LATALIGNMENT_SET
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_CARRIAGE_LENGTH_SET
const int VTYPEPARS_OSGFILE_SET
const int VTYPEPARS_LOCOMOTIVE_LENGTH_SET
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
const int VTYPEPARS_MINGAP_SET
const int VTYPEPARS_IMGFILE_SET
const int VTYPEPARS_SHAPE_SET
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
const int VTYPEPARS_LOADING_DURATION
const int VTYPEPARS_CONTAINER_CAPACITY
const int VTYPEPARS_CARRIAGE_GAP_SET
const int VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_PROBABILITY_SET
const int VTYPEPARS_CAR_FOLLOW_MODEL
const int VTYPEPARS_MINGAP_LAT_SET
const int VTYPEPARS_WIDTH_SET
bool canParseVehicleShape(const std::string &shape)
Checks whether the given string contains only known vehicle shape.
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PEDESTRIAN
pedestrian
const std::string DEFAULT_PEDTYPE_ID
@ SVS_TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ SVS_RAIL
render as a rail
@ SVS_BUS_FLEXIBLE
render as a flexible city bus
@ SVS_RAIL_CARGO
render as a cargo train
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
const std::string DEFAULT_VTYPE_ID
const std::string DEFAULT_BIKETYPE_ID
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_VTYPE
description of a vehicle type
@ SUMO_TAG_PTYPE
description of a person type (used in NETEDIT)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_EMISSIONCLASS
@ SUMO_ATTR_JM_IGNORE_FOE_SPEED
@ SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME
@ SUMO_ATTR_CF_WIEDEMANN_SECURITY
@ SUMO_ATTR_LCA_ASSERTIVE
@ SUMO_ATTR_CF_IDMM_ADAPT_TIME
@ SUMO_ATTR_LANE_CHANGE_MODEL
@ SUMO_ATTR_CF_KERNER_PHI
@ SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE
@ SUMO_ATTR_LCA_LOOKAHEADLEFT
@ SUMO_ATTR_APPARENTDECEL
@ SUMO_ATTR_LCA_SPEEDGAIN_PARAM
@ SUMO_ATTR_ACTIONSTEPLENGTH
@ SUMO_ATTR_LCA_IMPATIENCE
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
@ SUMO_ATTR_LOADING_DURATION
@ SUMO_ATTR_LCA_MAXSPEEDLATFACTOR
@ GNE_ATTR_DEFAULT_VTYPE
Flag to check if VType is a default VType.
@ SUMO_ATTR_CF_PWAGNER2009_TAULAST
@ SUMO_ATTR_CAR_FOLLOW_MODEL
@ SUMO_ATTR_LCA_MAXSPEEDLATSTANDING
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
@ SUMO_ATTR_LCA_KEEPRIGHT_PARAM
@ SUMO_ATTR_JM_IGNORE_FOE_PROB
@ SUMO_ATTR_CONTAINER_CAPACITY
@ SUMO_ATTR_LCA_COOPERATIVE_PARAM
@ SUMO_ATTR_LCA_OPPOSITE_PARAM
@ SUMO_ATTR_EMERGENCYDECEL
@ SUMO_ATTR_LCA_SUBLANE_PARAM
@ SUMO_ATTR_JM_CROSSING_GAP
@ SUMO_ATTR_CARRIAGE_LENGTH
@ SUMO_ATTR_CF_IDM_STEPPING
@ SUMO_ATTR_CF_IDMM_ADAPT_FACTOR
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_JM_SIGMA_MINOR
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_CF_PWAGNER2009_APPROB
@ GNE_ATTR_DEFAULT_VTYPE_MODIFIED
Flag to check if a default VType was modified.
@ SUMO_ATTR_LCA_OVERTAKE_RIGHT
@ SUMO_ATTR_LCA_ACCEL_LAT
@ SUMO_ATTR_LCA_STRATEGIC_PARAM
@ SUMO_ATTR_PERSON_CAPACITY
@ SUMO_ATTR_LCA_EXPERIMENTAL1
@ SUMO_ATTR_LOCOMOTIVE_LENGTH
@ SUMO_ATTR_JM_DRIVE_RED_SPEED
@ SUMO_ATTR_LCA_TIME_TO_IMPATIENCE
@ SUMO_ATTR_JM_TIMEGAP_MINOR
@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION
@ SUMO_ATTR_LCA_SPEEDGAINRIGHT
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * myNet
pointer to net
const GNETagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
bool requireUpdateGeometry() const
return true if atribute requires a update geometry in setAttribute(...)
the function-object for an editing operation (abstract base)
void forceChange()
force change
An Element which don't belongs to GNENet but has influency in the simulation.
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform demand element changes
const std::string & getID() const
get ID
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void updateID(GNEAttributeCarrier *AC, const std::string newID)
update ID
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
const GNEAttributeProperties & getAttributeProperties(SumoXMLAttr attr) const
get attribute (throw error if doesn't exist)
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
double getAttributeDouble(SumoXMLAttr key) const
static void overwriteVType(GNEDemandElement *vType, SUMOVTypeParameter *newVTypeParameter, GNEUndoList *undoList)
overwrite all values of GNEVehicleType with a SUMOVTypeParameter
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
Position getPositionInView() const
Returns position of additional in view.
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
GNEVehicleType(GNENet *net, const std::string &vTypeID, const SUMOVehicleClass &defaultVClass, SumoXMLTag tag)
constructor for default VTypes
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
bool myDefaultVehicleType
flag to check if this GNEVehicleType is a default vehicle Type (For Vehicles, Pedestrians....
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const double offsetFront) const
Draws partial object.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
SUMOVehicleClass getVClass() const
void initRailVisualizationParameters()
init Rail Visualization Parameters
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void updateDefaultVClassAttributes(const VClassDefaultValues &defaultValues)
function called after set new VClass
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
std::string getParentName() const
Returns the name of the parent object.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void updateGeometry()
update pre-computed geometry information
void startGeometryMoving()
void endGeometryMoving()
end geometry movement
const RGBColor & getColor() const
get color
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void invalidatePath()
invalidate path
bool myDefaultVehicleTypeModified
flag to check if this default GNEVehicleType was modified
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
void computePath()
compute path
bool isAttributeEnabled(SumoXMLAttr key) const
~GNEVehicleType()
destructor
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
void unsetParameter(const std::string &key)
Removes a parameter.
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
static const std::vector< std::string > & getAllClassesStr()
Get all SUMOEmissionClass in string format.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
A point in 2D or 3D with translation and scaling methods.
Structure representing possible vehicle parameter.
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....
double height
This class' height.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
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 and locomotive
double length
The physical vehicle length.
double maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
LateralAlignment latAlignment
The vehicles desired lateral alignment.
bool wasSet(int what) const
Returns whether the given parameter was set.
double minGap
This class' free space in front of the vehicle itself.
std::string imgFile
Image file for this class.
SUMOVehicleShape shape
This class' shape.
int personCapacity
The person capacity of the vehicle.
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
std::string osgFile
3D model file for this class
double maxSpeed
The vehicle type's maximum speed [m/s].
int parametersSet
Information for the router which parameter were set.
int containerCapacity
The container capacity of the vehicle.
SUMOTime boardingDuration
The time a person needs to board the vehicle.
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].
SUMOVehicleClass vehicleClass
The vehicle's class.
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.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
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.
SubParams jmParameter
Junction-model parameter.
double impatience
The vehicle's impatience (willingness to obstruct others)
LaneChangeModel lcModel
The lane-change model to use.
static StringBijection< SumoXMLTag > CarFollowModels
car following models
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
static StringBijection< TrainType > TrainTypes
train types
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
bool hasString(const std::string &str) const
const std::string & getString(const T key) const
T get(const std::string &str) const
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
struct for default values that depend of VClass
double height
This class' height.
int personCapacity
The person capacity of the vehicle.
double carriageLength
the length of train carriages
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].
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.
double length
The physical vehicle length.
SUMOVehicleShape shape
This class' shape.
double locomotiveLength
the length of train locomotive