 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
40 GNEDemandElement(vTypeID, viewNet,
GLO_VTYPE, tag, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
42 myDefaultVehicleType(
true),
43 myDefaultVehicleTypeModified(
false) {
45 vehicleClass = defaultVClass;
48 initRailVisualizationParameters();
53 GNEDemandElement(vTypeParameter.id, viewNet,
GLO_VTYPE, tag, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
55 myDefaultVehicleType(
false),
56 myDefaultVehicleTypeModified(
false) {
63 initRailVisualizationParameters();
68 GNEDemandElement(vTypeID, viewNet,
GLO_VTYPE, vTypeOriginal->getTagProperty().getTag(), {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
70 myDefaultVehicleType(
false),
71 myDefaultVehicleTypeModified(
false) {
75 initRailVisualizationParameters();
156 i->updatePartialGeometry(edge);
188 return Boundary(-0.1, -0.1, 0.1, 0.1);
499 return defaultValues.
length;
505 return defaultValues.
minGap;
511 return defaultValues.
width;
517 return defaultValues.
height;
657 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
679 return canParse<double>(value);
685 return canParse<double>(value) && (parse<double>(value) >= 0);
687 return canParse<double>(value) && (parse<double>(value) >= -1);
689 return canParse<double>(value) && (parse<double>(value) >= -1);
691 return canParse<double>(value) && (parse<double>(value) >= -1);
693 return canParse<double>(value) && (parse<double>(value) >= 0);
695 return canParse<double>(value) && (parse<double>(value) >= 0);
697 return canParse<double>(value) && (parse<double>(value) >= 0);
699 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
701 return canParse<double>(value) && (parse<double>(value) >= 0);
703 return canParse<double>(value) && (parse<double>(value) >= 0);
712 return canParse<double>(value);
719 return canParse<double>(value) && (parse<double>(value) >= 0);
725 return canParse<double>(value) && (parse<double>(value) > 0);
731 return canParse<double>(value) && (parse<double>(value) > 0);
733 return canParse<double>(value) && (parse<double>(value) >= 0);
735 return canParse<double>(value) && (parse<double>(value) >= 0);
737 return canParse<double>(value) && (parse<double>(value) >= 0);
739 return canParse<double>(value) && (parse<double>(value) >= 0);
744 return canParse<RGBColor>(value);
757 if (value ==
"all") {
763 return canParse<double>(value);
765 return canParse<double>(value);
773 return canParse<int>(value);
775 return canParse<int>(value);
777 return canParse<double>(value);
779 return canParse<double>(value);
783 return canParse<double>(value);
785 return canParse<double>(value);
787 return canParse<double>(value) && (parse<double>(value) >= 0);
789 return canParse<double>(value) && (parse<double>(value) >= 0);
793 return canParse<double>(value) && (parse<double>(value) >= -1);
795 return canParse<double>(value) && (parse<double>(value) >= -1);
797 return canParse<double>(value) && (parse<double>(value) >= 0);
802 return canParse<bool>(value);
1116 std::string parametersStr;
1119 parametersStr += i.first +
"=" + i.second +
"|";
1122 if (!parametersStr.empty()) {
1123 parametersStr.pop_back();
1217 if (value.empty()) {
1237 if (value.empty()) {
1277 if (value.empty()) {
1290 if (value.empty() || (canParse<double>(value) && (parse<double>(value) == 0))) {
1301 if (!value.empty() && (value !=
toString(defaultValues.
length))) {
1302 length = parse<double>(value);
1313 if (!value.empty() && (value !=
toString(defaultValues.
minGap))) {
1314 minGap = parse<double>(value);
1362 color = parse<RGBColor>(value);
1397 if (!value.empty() && (value !=
toString(defaultValues.
shape))) {
1409 if (!value.empty() && (value !=
toString(defaultValues.
width))) {
1410 width = parse<double>(value);
1421 if (!value.empty() && (value !=
toString(defaultValues.
height))) {
1422 height = parse<double>(value);
1577 if (!value.empty() && (value != defaultValues.
osgFile)) {
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
const int VTYPEPARS_LATALIGNMENT_SET
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
@ SUMO_ATTR_BOARDING_DURATION
@ SUMO_ATTR_LCA_SPEEDGAIN_PARAM
@ SVC_PEDESTRIAN
pedestrian
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
SubParams lcParameter
Lane-changing parameter.
@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION
An Element which don't belongs to GNENet but has influency in the simulation.
double carriageLength
the length of train carriages
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
const int VTYPEPARS_CARRIAGE_LENGTH_SET
GNEEdge * getToEdge() const
obtain to edge of this demand element
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
double length
The physical vehicle length.
@ SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
const int VTYPEPARS_MINGAP_SET
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
@ SUMO_ATTR_CF_IDMM_ADAPT_FACTOR
const std::string DEFAULT_PEDTYPE_ID
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
@ SUMO_ATTR_LCA_COOPERATIVE_PARAM
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
@ SUMO_ATTR_CF_IDM_STEPPING
Static storage of an output device and its base (abstract) implementation.
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
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.
std::string getParentName() const
Returns the name of the parent object.
const std::string & getString(const T key) const
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
~GNEVehicleType()
destructor
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
void updateGeometry()
update pre-computed geometry information
double impatience
The vehicle's impatience (willingness to obstruct others)
@ SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME
std::string osgFile
3D model file for this class
@ SUMO_ATTR_CF_PWAGNER2009_APPROB
const int VTYPEPARS_MINGAP_LAT_SET
bool myDefaultVehicleType
flag to check if this GNEVehicleType is a default vehicle Type (For Vehicles, Pedestrians....
@ SUMO_ATTR_LOADING_DURATION
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
@ SUMO_TAG_PTYPE
description of a person type (used in NETEDIT)
@ SUMO_ATTR_COLOR
A color information.
const int VTYPEPARS_OSGFILE_SET
double carriageLength
the length of train carriages and locomotive
std::vector< double > & getParameter()
Returns the parameters of this distribution.
@ SUMO_ATTR_CONTAINER_CAPACITY
SUMOVehicleShape shape
This class' shape.
const int VTYPEPARS_PROBABILITY_SET
@ 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_LCA_MAXSPEEDLATFACTOR
@ SUMO_ATTR_LCA_KEEPRIGHT_PARAM
@ SUMO_ATTR_LANE_CHANGE_MODEL
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
const int VTYPEPARS_LOCOMOTIVE_LENGTH_SET
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
int containerCapacity
The container capacity of the vehicle.
void computePath()
compute path
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool requireUpdateGeometry() const
return true if atribute requires a update geometry in setAttribute(...)
@ SUMO_ATTR_JM_IGNORE_FOE_PROB
@ SUMO_ATTR_LCA_EXPERIMENTAL1
@ SUMO_ATTR_JM_TIMEGAP_MINOR
@ SVS_BUS_FLEXIBLE
render as a flexible city bus
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
const int VTYPEPARS_CAR_FOLLOW_MODEL
@ SUMO_ATTR_JM_IGNORE_FOE_SPEED
static StringBijection< SumoXMLTag > CarFollowModels
car following models
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
@ SUMO_ATTR_LCA_MAXSPEEDLATSTANDING
A road/street connecting two junctions (netedit-version)
friend class GNEChange_Attribute
declare friend class
bool wasSet(int what) const
Returns whether the given parameter was set.
int parametersSet
Information for the router which parameter were set.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
const int VTYPEPARS_MAXSPEED_LAT_SET
void changeDemandElementID(const std::string &newID)
change ID of demand element
GNENet * getNet() const
get the net object
@ SUMO_ATTR_LCA_SUBLANE_PARAM
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
@ SUMO_ATTR_APPARENTDECEL
void endGeometryMoving()
end geometry movement
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
std::string imgFile
Image file for this class.
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.
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
int containerCapacity
The container capacity of the vehicle.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
double height
This class' height.
@ SUMO_ATTR_LCA_OPPOSITE_PARAM
virtual std::string getAttribute(SumoXMLAttr key) const =0
Structure representing possible vehicle parameter.
@ GNE_ATTR_DEFAULT_VTYPE_MODIFIED
Flag to check if a default VType was modified.
bool canParseVehicleShape(const std::string &shape)
Checks whether the given string contains only known vehicle shape.
SubParams jmParameter
Junction-model parameter.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
T get(const std::string &str) const
SubParams cfParameter
Car-following parameter.
double defaultProbability
The probability when being added to a distribution without an explicit probability.
const std::string DEFAULT_VTYPE_ID
double maxSpeed
The vehicle type's maximum speed [m/s].
GNEEdge * getFromEdge() const
void startGeometryMoving()
@ SUMO_ATTR_LCA_SPEEDGAINRIGHT
GNEVehicleType(GNEViewNet *viewNet, const std::string &vTypeID, const SUMOVehicleClass &defaultVClass, SumoXMLTag tag)
constructor for default VTypes
GUIGlID getGlID() const
Returns the numerical id of the object.
A class that stores a 2D geometrical boundary.
@ SUMO_ATTR_JM_DRIVE_RED_SPEED
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
@ SVS_RAIL_CARGO
render as a cargo train
@ SUMO_ATTR_PERSON_CAPACITY
double width
This class' width.
const int VTYPEPARS_CARRIAGE_GAP_SET
@ SUMO_ATTR_LCA_LOOKAHEADLEFT
A point in 2D or 3D with translation and scaling methods.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
SUMOTime boardingDuration
The time a person needs to board the vehicle.
double minGap
This class' free space in front of the vehicle itself.
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
double minGap
This class' free space in front of the vehicle itself.
@ SUMO_ATTR_LCA_OVERTAKE_RIGHT
std::string time2string(SUMOTime t)
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.
@ SUMO_ATTR_LCA_STRATEGIC_PARAM
double width
This class' width.
@ SUMO_ATTR_JM_SIGMA_MINOR
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].
@ GNE_ATTR_DEFAULT_VTYPE
Flag to check if VType is a default VType.
int personCapacity
The person capacity of the vehicle.
SUMOVehicleShape shape
This class' shape.
const int VTYPEPARS_SPEEDFACTOR_SET
@ SUMO_ATTR_LCA_IMPATIENCE
void write(OutputDevice &dev) const
Writes the vtype.
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
SUMOTime string2time(const std::string &r)
@ SUMO_ATTR_LCA_ASSERTIVE
void updatePartialGeometry(const GNEEdge *edge)
partial update pre-computed geometry information
void invalidatePath()
invalidate path
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
@ SUMO_ATTR_CF_WIEDEMANN_SECURITY
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
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
std::string osgFile
3D model file for this class
@ SUMO_ATTR_JM_CROSSING_GAP
const int VTYPEPARS_LOADING_DURATION
double locomotiveLength
the length of train locomotive
const int VTYPEPARS_CONTAINER_CAPACITY
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const RGBColor & getColor() const
get color
@ SUMO_ATTR_CF_PWAGNER2009_TAULAST
double getAttributeDouble(SumoXMLAttr key) const
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
LateralAlignment latAlignment
The vehicles desired lateral alignment.
@ SUMO_ATTR_CAR_FOLLOW_MODEL
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
void unsetParameter(const std::string &key)
Removes a parameter.
static StringBijection< TrainType > TrainTypes
train types
@ SUMO_ATTR_LCA_TIME_TO_IMPATIENCE
struct for default values that depend of VClass
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
const int VTYPEPARS_PERSON_CAPACITY
@ SUMO_ATTR_CARRIAGE_LENGTH
void initRailVisualizationParameters()
init Rail Visualization Parameters
static void overwriteVType(GNEDemandElement *vType, SUMOVTypeParameter *newVTypeParameter, GNEUndoList *undoList)
overwrite all values of GNEVehicleType with a SUMOVTypeParameter
GUISelectedStorage gSelected
A global holder of selected objects.
const std::string & getDemandElementID() const
returns DemandElement ID
@ SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME
const int VTYPEPARS_HEIGHT_SET
@ SUMO_ATTR_EMERGENCYDECEL
@ SVS_TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
int personCapacity
The person capacity of the vehicle.
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
LaneChangeModel lcModel
The lane-change model to use.
const int VTYPEPARS_IMGFILE_SET
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
const AttributeProperties & getAttributeProperties(SumoXMLAttr attr) const
get attribute (throw error if doesn't exist)
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.
void updateDefaultVClassAttributes(const VClassDefaultValues &defaultValues)
function called after set new VClass
bool hasString(const std::string &str) const
bool isAttributeEnabled(SumoXMLAttr key) const
@ SUMO_ATTR_ACTIONSTEPLENGTH
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
@ SUMO_ATTR_LOCOMOTIVE_LENGTH
static const std::vector< std::string > & getAllClassesStr()
Get all SUMOEmissionClass in string format.
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
Position getPositionInView() const
Returns position of additional in view.
const int VTYPEPARS_LENGTH_SET
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
bool myDefaultVehicleTypeModified
flag to check if this default GNEVehicleType was modified
void removeLockedObject(const GUIGlObjectType type)
set object unselected
const std::string & getTagStr() const
get tag assigned to this object in string format
SUMOEmissionClass emissionClass
The emission class of this vehicle.
Stores the information about how to visualize structures.
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_SHAPE_SET
double height
This class' height.
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...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const std::string DEFAULT_BIKETYPE_ID
const int VTYPEPARS_WIDTH_SET
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SUMOVehicleClass vehicleClass
The vehicle's class.
const int VTYPEPARS_IMPATIENCE_SET
@ 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
void deselect(GUIGlID id)
Deselects the object with the given id.
GNEViewParent * getViewParent() const
get the net object
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
std::string getAttribute(SumoXMLAttr key) const
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
const int VTYPEPARS_VEHICLECLASS_SET
@ SUMO_ATTR_CF_KERNER_PHI
@ SUMO_ATTR_CF_IDMM_ADAPT_TIME
@ SUMO_ATTR_LCA_ACCEL_LAT
double minGapLat
The vehicle type's minimum lateral gap [m].
@ SVS_RAIL
render as a rail
@ SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE
void addedLockedObject(const GUIGlObjectType type)
set object selected