43 myDeterministic(deterministic) {
59 std::vector<std::string> vTypes;
60 std::vector<std::string> probabilities;
65 for (
int i = 0; i < (int)typeDistributionIDs.size(); i++) {
66 if (typeDistributionIDs.at(i) ==
getID()) {
67 vTypes.push_back(vType->getID());
68 probabilities.push_back(distributionProbabilities.at(i));
73 if (vTypes.size() > 0) {
135 return Boundary(-0.1, -0.1, 0.1, 0.1);
213 std::map<std::string, GNEDemandElement*> sortedTypes;
216 sortedTypes[type->getID()] = type;
220 if (sortedTypes.size() > 0) {
221 return sortedTypes.begin()->second->getAttributeDouble(key);
255 if (value ==
getID()) {
263 if (value ==
"-1" || value.empty()) {
266 return canParse<int>(value) && (parse<int>(value) >= 0);
GUIIcon
An enumeration of icons used by the gui applications.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_VTYPE_DISTRIBUTION
vehicle type distribution
@ GNE_ATTR_ADDITIONALCHILDREN
check number of additional children (used in vTypeDistribution)
@ SUMO_ATTR_DETERMINISTIC
@ GNE_ATTR_VTYPE_DISTRIBUTION_PROBABILITY
vehicle type distribution
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
const std::string getID() const
get ID (all Attribute Carriers have one)
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
An Element which don't belong to GNENet but has influence in the simulation.
bool demandElementExist(const std::string &id, const std::vector< SumoXMLTag > tags) const
check if the given demand element exist
Problem
enum class for demandElement problems
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const std::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object.
std::string getParentName() const
Returns the name of the parent object.
void computePathElement()
compute pathElement
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
Problem isDemandElementValid() const
check if current demand element is valid to be writed into XML
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
~GNEVTypeDistribution()
destructor
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
GNELane * getFirstPathLane() const
get first path lane
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Position getPositionInView() const
Returns position of additional in view.
void updateGeometry()
update pre-computed geometry information
GNEVTypeDistribution(GNENet *net)
default constructor
const RGBColor & getColor() const
get color
double getAttributeDouble(SumoXMLAttr key) const
int myDeterministic
deterministic attribute
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
SUMOVehicleClass getVClass() const
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const Parameterised::Map & getACParametersMap() const
get parameters map
GNELane * getLastPathLane() const
get last path lane
Position getAttributePosition(SumoXMLAttr key) const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEMoveOperation * getMoveOperation()
get move operation
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void fixDemandElementProblem()
fix demand element problem
std::string getDemandElementProblem() const
return a string with the current demand element problem
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
static const RGBColor BLACK
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
std::vector< std::string > getVector()
return vector of strings