41 GNEDemandElement(vTypeID, viewNet,
GLO_VTYPE, tag, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
54 GNEDemandElement(vTypeParameter.
id, viewNet,
GLO_VTYPE, tag, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
69 GNEDemandElement(vTypeID, viewNet,
GLO_VTYPE, vTypeOriginal->
getTagProperty().getTag(), {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
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)) {
std::string osgFile
3D model file for this class
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_MAXSPEED_SET
std::string getGenericParametersStr() const
return generic parameters in string format
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
const int VTYPEPARS_MINGAP_SET
void endGeometryMoving()
end geometry movement
static StringBijection< SumoXMLTag > CarFollowModels
car following models
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
const int VTYPEPARS_LATALIGNMENT_SET
void startGeometryMoving()
description of a vehicle type
void addedLockedObject(const GUIGlObjectType type)
set object selected
double impatience
The vehicle's impatience (willingness to obstruct others)
const int VTYPEPARS_HASDRIVERSTATE_SET
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
std::string getParentName() const
Returns the name of the parent object.
double carriageLength
the length of train carriages and locomotive
Position getPositionInView() const
Returns position of additional in view.
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
SUMOVehicleShape shape
This class' shape.
double maxSpeed
The vehicle type's maximum speed [m/s].
Structure representing possible vehicle parameter.
const int VTYPEPARS_MINGAP_LAT_SET
SUMOVTypeParameter(const std::string &vtid, const SUMOVehicleClass vc=SVC_IGNORING)
Constructor.
Stores the information about how to visualize structures.
const std::string & getString(const T key) const
double defaultProbability
The probability when being added to a distribution without an explicit probability.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
render as a flexible city bus
GNEViewParent * getViewParent() const
get the net object
static void overwriteVType(GNEDemandElement *vType, SUMOVTypeParameter *newVTypeParameter, GNEUndoList *undoList)
overwrite all values of GNEVehicleType with a SUMOVTypeParameter
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
bool myDefaultVehicleTypeModified
flag to check if this default GNEVehicleType was modified
void unsetParameter(const std::string &key)
Removes a parameter.
int containerCapacity
The container capacity of the vehicle.
double width
This class' width.
const int VTYPEPARS_BOARDING_DURATION
std::string time2string(SUMOTime t)
SUMOVehicleClass vehicleClass
The vehicle's class.
~GNEVehicleType()
destructor
GNEEdge * getToEdge() const
obtain to edge of this demand element
std::vector< double > & getParameter()
Returns the parameters of this distribution.
const int VTYPEPARS_LOCOMOTIVE_LENGTH_SET
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...
GNEVehicleType(GNEViewNet *viewNet, const std::string &vTypeID, const SUMOVehicleClass &defaultVClass, SumoXMLTag tag)
constructor for default VTypes
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const std::string DEFAULT_BIKETYPE_ID
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const int VTYPEPARS_CAR_FOLLOW_MODEL
void changeDemandElementID(const std::string &newID)
change ID of demand element
const int VTYPEPARS_OSGFILE_SET
bool hasNext()
returns the information whether further substrings exist
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
const int VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_PROBABILITY_SET
const std::string DEFAULT_VTYPE_ID
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.
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
A class that stores a 2D geometrical boundary.
const RGBColor & getColor() const
get color
double getAttributeDouble(SumoXMLAttr key) const
double height
This class' height.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
int personCapacity
The person capacity of the vehicle.
bool canParseVehicleShape(const std::string &shape)
Checks whether the given string contains only known vehicle shape.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
SUMOVehicleShape shape
This class' shape.
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
bool wasSet(int what) const
Returns whether the given parameter was set.
virtual std::string getGenericParametersStr() const =0
return generic parameters in string format
double maxSpeed
The vehicle type's maximum speed [m/s].
double width
This class' width.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
SUMOTime boardingDuration
The time a person needs to board the vehicle.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
std::string osgFile
3D model file for this class
GNEEdge * getFromEdge() const
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeLockedObject(const GUIGlObjectType type)
set object unselected
double locomotiveLength
the length of train locomotive
void compute()
compute demand element
friend class GNEChange_Attribute
declare friend class
T get(const std::string &str) const
struct for default values that depend of VClass
std::string imgFile
Image file for this class.
double length
The physical vehicle length.
std::string getAttribute(SumoXMLAttr key) const
SUMOTime string2time(const std::string &r)
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
const std::string & getDemandElementID() const
returns DemandElement ID
render as a (city) rail without locomotive
const int VTYPEPARS_CARRIAGE_GAP_SET
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
const int VTYPEPARS_LOADING_DURATION
double carriageLength
the length of train carriages
const int VTYPEPARS_CONTAINER_CAPACITY
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
bool myDefaultVehicleType
flag to check if this GNEVehicleType is a default vehicle Type (For Vehicles, Pedestrians...)
const int VTYPEPARS_SPEEDFACTOR_SET
static StringBijection< TrainType > TrainTypes
train types
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.
int parametersSet
Information for the router which parameter were set.
double height
This class' height.
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
bool isAttributeEnabled(SumoXMLAttr key) const
A road/street connecting two junctions (netedit-version)
int personCapacity
The person capacity of the vehicle.
bool hasDriverState
Whether vehicles of this type are equipped with a driver (i.e. MSDriverState))
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
double minGapLat
The vehicle type's minimum lateral gap [m].
void updateGeometry()
update pre-computed geometry information
void write(OutputDevice &dev) const
Writes the vtype.
int containerCapacity
The container capacity of 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.
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street...
void deselect(GUIGlID id)
Deselects the object with the given id.
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
Flag to check if VType is a default VType.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
void updateDefaultVClassAttributes(const VClassDefaultValues &defaultValues)
function called after set new VClass
const std::string DEFAULT_PEDTYPE_ID
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
const std::string & getTagStr() const
get tag assigned to this object in string format
SubParams jmParameter
Junction-model parameter.
const int VTYPEPARS_IMGFILE_SET
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 ...
SubParams cfParameter
Car-following parameter.
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
std::string id
The vehicle type's id.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes ...
SUMOEmissionClass emissionClass
The emission class of this vehicle.
const int VTYPEPARS_PERSON_CAPACITY
GNENet * getNet() const
get the net object
LateralAlignment latAlignment
The vehicles desired lateral alignment.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
SUMOTime actionStepLength
The vehicle type's default actionStepLength [ms], i.e. the interval between two control actions...
GUIGlID getGlID() const
Returns the numerical id of the object.
double minGap
This class' free space in front of the vehicle itself.
const int VTYPEPARS_HEIGHT_SET
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
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.
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
Static storage of an output device and its base (abstract) implementation.
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
description of a person type (used in NETEDIT)
const int VTYPEPARS_WIDTH_SET
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) ...
bool hasString(const std::string &str) const
LaneChangeModel lcModel
The lane-change model to use.
render as a transport vehicle with one trailer
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_VEHICLECLASS_SET
Flag to check if a default VType was modified.
GUISelectedStorage gSelected
A global holder of selected objects.
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name) ...
void initRailVisualizationParameters()
init Rail Visualization Parameters
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_COLOR_SET
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street...
render as a semi-trailer transport vehicle ("Sattelschlepper")
const int VTYPEPARS_SHAPE_SET
double length
The physical vehicle length.
SubParams lcParameter
Lane-changing parameter.
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
SUMOEmissionClass emissionClass
The emission class of this vehicle.
double minGap
This class' free space in front of the vehicle itself.
static const std::vector< std::string > & getAllClassesStr()
Get all SUMOEmissionClass in string format.
An Element which don't belongs to GNENet but has influency in the simulation.
const int VTYPEPARS_IMPATIENCE_SET
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
void clearParameter()
Clears the parameter map.
const int VTYPEPARS_CARRIAGE_LENGTH_SET