36 const std::vector<GNEJunction*>& parentJunctions,
37 const std::vector<GNEEdge*>& parentEdges,
38 const std::vector<GNELane*>& parentLanes,
39 const std::vector<GNEAdditional*>& parentAdditionals,
40 const std::vector<GNEDemandElement*>& ParentDemandElements,
41 const std::vector<GNEGenericData*>& parentGenericDatas) :
43 myHierarchicalContainer(parentJunctions, parentEdges, parentLanes, parentAdditionals, ParentDemandElements, parentGenericDatas) {
62std::vector<GNEHierarchicalElement*>
65 std::vector<GNEHierarchicalElement*> result;
70 result.push_back(element);
73 result.push_back(element);
76 result.push_back(element);
79 result.push_back(element);
82 result.push_back(element);
85 result.push_back(element);
89 result.push_back(element);
92 result.push_back(element);
95 result.push_back(element);
98 result.push_back(element);
101 result.push_back(element);
104 result.push_back(element);
110const std::vector<GNEJunction*>&
116const std::vector<GNEEdge*>&
122const std::vector<GNELane*>&
128const std::vector<GNEAdditional*>&
134const std::vector<GNEAdditional*>
136 std::vector<GNEAdditional*> stoppingPlaces;
138 if (additional->getTagProperty().isStoppingPlace()) {
139 stoppingPlaces.push_back(additional);
142 return stoppingPlaces;
146const std::vector<GNEAdditional*>
148 std::vector<GNEAdditional*> TAZs;
150 if (additional->getTagProperty().isTAZElement()) {
151 TAZs.push_back(additional);
158const std::vector<GNEDemandElement*>&
164const std::vector<GNEGenericData*>&
170const std::vector<GNEJunction*>&
176const std::vector<GNEEdge*>&
182const std::vector<GNELane*>&
188const std::vector<GNEAdditional*>&
194const std::vector<GNEDemandElement*>&
200const std::vector<GNEGenericData*>&
376 std::vector<std::string> solution;
383 solution.push_back(edge->getID());
385 if (edge == currentElement) {
386 solution.push_back(newNextElement->
getID());
395 solution.push_back(lane->getID());
397 if (lane == currentElement) {
398 solution.push_back(newNextElement->
getID());
403 solution.erase(std::unique(solution.begin(), solution.end()), solution.end());
412 std::vector<std::pair<std::pair<double, double>,
GNEAdditional*> > sortedChildren;
415 sortedChildren.push_back(std::make_pair(std::make_pair(0., 0.), meanData));
417 if (meanData->getTagProperty().hasAttribute(
SUMO_ATTR_TIME) && GNEAttributeCarrier::canParse<double>(meanData->getAttribute(
SUMO_ATTR_TIME))) {
419 }
else if (meanData->getTagProperty().hasAttribute(
SUMO_ATTR_BEGIN) && GNEAttributeCarrier::canParse<double>(meanData->getAttribute(
SUMO_ATTR_BEGIN))) {
420 sortedChildren.back().first.first = meanData->getAttributeDouble(
SUMO_ATTR_BEGIN);
423 if (meanData->getTagProperty().hasAttribute(
SUMO_ATTR_END) && GNEAttributeCarrier::canParse<double>(meanData->getAttribute(
SUMO_ATTR_END))) {
424 sortedChildren.back().first.second = meanData->getAttributeDouble(
SUMO_ATTR_END);
426 sortedChildren.back().first.second = sortedChildren.back().first.first;
430 std::sort(sortedChildren.begin(), sortedChildren.end());
433 if (sortedChildren.size() <= 1) {
437 for (
int i = 0; i < (int)sortedChildren.size() - 1; i++) {
438 if (sortedChildren.at(i).first.second > sortedChildren.at(i + 1).first.first) {
445 throw ProcessError(
TL(
"Some child meanData were lost during sorting"));
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_TIME
trigger: the time of the step
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An Element which don't belong to GNENet but has influence in the simulation.
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const std::string getID() const
get ID (all Attribute Carriers have one)
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
A road/street connecting two junctions (netedit-version)
An Element which don't belong to GNENet but has influence in the simulation.
Hierarchical container (used for keep myParent and myChildren.
void addParentElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
add parent element
size_t getContainerSize() const
get container size
const T & getChildren() const
get children
void addChildElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
add child element
void removeParentElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
remove parent element
void removeChildElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
remove child element
const T & getParents() const
get parents
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
void addChildElement(T *element)
add child element
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
GNEHierarchicalElement(GNENet *net, SumoXMLTag tag, const std::vector< GNEJunction * > &parentJunctions, const std::vector< GNEEdge * > &parentEdges, const std::vector< GNELane * > &parentLanes, const std::vector< GNEAdditional * > &parentAdditionals, const std::vector< GNEDemandElement * > &parentDemandElements, const std::vector< GNEGenericData * > &parentGenericDatas)
Constructor.
~GNEHierarchicalElement()
Destructor.
const std::vector< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
bool checkChildAdditionalsOverlapping() const
check if children are overlapped (Used by Rerouters)
const std::vector< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainer & getHierarchicalContainer() const
get hierarchicalcontainer with parents and children
const std::vector< GNEAdditional * > getParentStoppingPlaces() const
get parent stoppingPlaces (used by plans)
const std::vector< GNEAdditional * > getParentTAZs() const
get parent TAZs (used by plans)
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
GNEHierarchicalContainer myHierarchicalContainer
hierarchical container with parents and children
bool checkChildDemandElementsOverlapping() const
check if childs demand elements are overlapped
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
void addParentElement(T *element)
add parent element
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
std::vector< GNEHierarchicalElement * > getAllHierarchicalElements() const
get all parents and children
void removeChildElement(T *element)
remove child element
std::string getNewListOfParents(const GNENetworkElement *currentElement, const GNENetworkElement *newNextElement) const
if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after in...
const std::vector< GNEJunction * > & getChildJunctions() const
get child junctions
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
void removeParentElement(T *element)
remove parent element
void restoreHierarchicalContainer(const GNEHierarchicalContainer &container)
restore hierarchical container
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
A NBNetBuilder extended by visualisation and editing capabilities.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property