 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
41 GNEDemandElement(vTypeID, viewNet,
GLO_VTYPE, tag, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
43 myDefaultVehicleType(
true),
44 myDefaultVehicleTypeModified(
false) {
46 vehicleClass = defaultVClass;
49 initRailVisualizationParameters();
54 GNEDemandElement(vTypeParameter.id, viewNet,
GLO_VTYPE, tag, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
56 myDefaultVehicleType(
false),
57 myDefaultVehicleTypeModified(
false) {
64 initRailVisualizationParameters();
69 GNEDemandElement(vTypeID, viewNet,
GLO_VTYPE, vTypeOriginal->getTagProperty().getTag(), {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
71 myDefaultVehicleType(
false),
72 myDefaultVehicleTypeModified(
false) {
76 initRailVisualizationParameters();
171 return Boundary(-0.1, -0.1, 0.1, 0.1);
482 return defaultValues.
length;
488 return defaultValues.
minGap;
494 return defaultValues.
width;
500 return defaultValues.
height;
642 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
664 return canParse<double>(value);
670 return canParse<double>(value) && (parse<double>(value) >= 0);
672 return canParse<double>(value) && (parse<double>(value) >= -1);
674 return canParse<double>(value) && (parse<double>(value) >= -1);
676 return canParse<double>(value) && (parse<double>(value) >= -1);
678 return canParse<double>(value) && (parse<double>(value) >= 0);
680 return canParse<double>(value) && (parse<double>(value) >= 0);
682 return canParse<double>(value) && (parse<double>(value) >= 0);
684 return canParse<double>(value) && (parse<double>(value) >= 0) && (parse<double>(value) <= 1);
686 return canParse<double>(value) && (parse<double>(value) >= 0);
688 return canParse<double>(value) && (parse<double>(value) >= 0);
697 return canParse<double>(value);
704 return canParse<double>(value) && (parse<double>(value) >= 0);
710 return canParse<double>(value) && (parse<double>(value) > 0);
716 return canParse<double>(value) && (parse<double>(value) > 0);
718 return canParse<double>(value) && (parse<double>(value) >= 0);
720 return canParse<double>(value) && (parse<double>(value) >= 0);
722 return canParse<double>(value) && (parse<double>(value) >= 0);
724 return canParse<double>(value) && (parse<double>(value) >= 0);
729 return canParse<RGBColor>(value);
742 if (value ==
"all") {
748 return canParse<double>(value);
750 return canParse<double>(value);
758 return canParse<int>(value);
760 return canParse<int>(value);
762 return canParse<double>(value);
764 return canParse<double>(value);
768 return canParse<double>(value);
770 return canParse<double>(value);
772 return canParse<double>(value) && (parse<double>(value) >= 0);
774 return canParse<double>(value) && (parse<double>(value) >= 0);
776 return canParse<bool>(value);
780 return canParse<double>(value) && (parse<double>(value) >= -1);
782 return canParse<double>(value) && (parse<double>(value) >= -1);
784 return canParse<double>(value) && (parse<double>(value) >= 0);
789 return canParse<bool>(value);
1093 std::string genericParametersStr;
1096 genericParametersStr += i.first +
"=" + i.second +
"|";
1099 if (!genericParametersStr.empty()) {
1100 genericParametersStr.pop_back();
1162 result += i.first +
"=" + i.second +
"|";
1165 if (!result.empty()) {
1172 std::vector<std::pair<std::string, std::string> >
1174 std::vector<std::pair<std::string, std::string> > result;
1177 result.push_back(std::make_pair(i.first, i.second));
1188 std::vector<std::string> parsedValues;
1191 parsedValues.push_back(stValues.
next());
1194 for (
auto i : parsedValues) {
1195 std::vector<std::string> parsedParameters;
1198 parsedParameters.push_back(stParam.
next());
1202 setParameter(parsedParameters.front(), parsedParameters.back());
1245 if (value.empty()) {
1265 if (value.empty()) {
1305 if (value.empty()) {
1318 if (value.empty() || (canParse<double>(value) && (parse<double>(value) == 0))) {
1329 if (!value.empty() && (value !=
toString(defaultValues.
length))) {
1330 length = parse<double>(value);
1341 if (!value.empty() && (value !=
toString(defaultValues.
minGap))) {
1342 minGap = parse<double>(value);
1390 color = parse<RGBColor>(value);
1425 if (!value.empty() && (value !=
toString(defaultValues.
shape))) {
1437 if (!value.empty() && (value !=
toString(defaultValues.
width))) {
1438 width = parse<double>(value);
1449 if (!value.empty() && (value !=
toString(defaultValues.
height))) {
1450 height = parse<double>(value);
1617 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
const int VTYPEPARS_HASDRIVERSTATE_SET
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.
An Element which don't belongs to GNENet but has influency in the simulation.
double carriageLength
the length of train carriages
const int VTYPEPARS_CARRIAGE_LENGTH_SET
GNEEdge * getToEdge() const
obtain to edge of this demand element
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
double length
The physical vehicle length.
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
const std::string DEFAULT_PEDTYPE_ID
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
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,...
bool hasNext()
returns the information whether further substrings exist
~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)
std::string osgFile
3D model file for this class
const int VTYPEPARS_MINGAP_LAT_SET
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
bool myDefaultVehicleType
flag to check if this GNEVehicleType is a default vehicle Type (For Vehicles, Pedestrians....
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
description of a person type (used in NETEDIT)
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
const int VTYPEPARS_OSGFILE_SET
double carriageLength
the length of train carriages and locomotive
SUMOVehicleShape shape
This class' shape.
const int VTYPEPARS_PROBABILITY_SET
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.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
const int VTYPEPARS_LOCOMOTIVE_LENGTH_SET
int containerCapacity
The container capacity of the vehicle.
SumoXMLTag
Numbers representing SUMO-XML - element names.
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
static StringBijection< SumoXMLTag > CarFollowModels
car following models
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
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
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.
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.
Structure representing possible vehicle parameter.
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()
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.
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
double width
This class' width.
const int VTYPEPARS_CARRIAGE_GAP_SET
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.
std::string time2string(SUMOTime t)
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
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.
void compute()
compute demand element
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].
Flag to check if VType is a default VType.
int personCapacity
The person capacity of the vehicle.
SUMOVehicleShape shape
This class' shape.
bool hasDriverState
Whether vehicles of this type are equipped with a driver (i.e. MSDriverState))
const int VTYPEPARS_SPEEDFACTOR_SET
void write(OutputDevice &dev) const
Writes the vtype.
render as a (city) rail without locomotive
SUMOTime string2time(const std::string &r)
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
virtual std::string getGenericParametersStr() const =0
return generic parameters in string format
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
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.
std::string osgFile
3D model file for this class
const int VTYPEPARS_LOADING_DURATION
double locomotiveLength
the length of train locomotive
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
const int VTYPEPARS_CONTAINER_CAPACITY
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const RGBColor & getColor() const
get color
double getAttributeDouble(SumoXMLAttr key) const
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
LateralAlignment latAlignment
The vehicles desired lateral alignment.
void unsetParameter(const std::string &key)
Removes a parameter.
static StringBijection< TrainType > TrainTypes
train types
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
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
const int VTYPEPARS_HEIGHT_SET
render as a semi-trailer transport vehicle ("Sattelschlepper")
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
std::string getGenericParametersStr() const
return generic parameters in string format
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.
void clearParameter()
Clears the parameter map.
const int VTYPEPARS_IMGFILE_SET
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
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
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
static const std::vector< std::string > & getAllClassesStr()
Get all SUMOEmissionClass in string format.
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
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
double minGapLat
The vehicle type's minimum lateral gap [m].
void addedLockedObject(const GUIGlObjectType type)
set object selected