37 const std::vector<GNEJunction*>& parentJunctions,
38 const std::vector<GNEEdge*>& parentEdges,
39 const std::vector<GNELane*>& parentLanes,
40 const std::vector<GNEAdditional*>& parentAdditionals,
41 const std::vector<GNEShape*>& parentShapes,
42 const std::vector<GNETAZElement*>& parentTAZElements,
43 const std::vector<GNEDemandElement*>& ParentDemandElements,
44 const std::vector<GNEGenericData*>& parentGenericDatas) :
46 myHierarchicalContainer(parentJunctions, parentEdges, parentLanes, parentAdditionals, parentShapes, parentTAZElements, ParentDemandElements, parentGenericDatas) {
65 std::vector<GNEHierarchicalElement*>
68 std::vector<GNEHierarchicalElement*> result;
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);
88 result.push_back(element);
91 result.push_back(element);
94 result.push_back(element);
98 result.push_back(element);
101 result.push_back(element);
104 result.push_back(element);
107 result.push_back(element);
110 result.push_back(element);
113 result.push_back(element);
116 result.push_back(element);
119 result.push_back(element);
125 const std::vector<GNEJunction*>&
131 const std::vector<GNEEdge*>&
137 const std::vector<GNELane*>&
143 const std::vector<GNEAdditional*>&
149 const std::vector<GNEShape*>&
155 const std::vector<GNETAZElement*>&
161 const std::vector<GNEDemandElement*>&
167 const std::vector<GNEGenericData*>&
173 const std::vector<GNEJunction*>&
179 const std::vector<GNEEdge*>&
185 const std::vector<GNELane*>&
191 const std::vector<GNEAdditional*>&
197 const std::vector<GNEShape*>&
203 const std::vector<GNETAZElement*>&
209 const std::vector<GNEDemandElement*>&
215 const std::vector<GNEGenericData*>&
447 std::vector<std::string> solution;
454 solution.push_back(edge->getID());
456 if (edge == currentElement) {
457 solution.push_back(newNextElement->
getID());
466 solution.push_back(lane->getID());
468 if (lane == currentElement) {
469 solution.push_back(newNextElement->
getID());
474 solution.erase(std::unique(solution.begin(), solution.end()), solution.end());
483 std::vector<std::pair<std::pair<double, double>,
GNEAdditional*> > sortedChildren;
486 sortedChildren.push_back(std::make_pair(std::make_pair(0., 0.), additional));
488 if (additional->getTagProperty().hasAttribute(
SUMO_ATTR_TIME) && GNEAttributeCarrier::canParse<double>(additional->getAttribute(
SUMO_ATTR_TIME))) {
490 }
else if (additional->getTagProperty().hasAttribute(
SUMO_ATTR_BEGIN) && GNEAttributeCarrier::canParse<double>(additional->getAttribute(
SUMO_ATTR_BEGIN))) {
491 sortedChildren.back().first.first = additional->getAttributeDouble(
SUMO_ATTR_BEGIN);
494 if (additional->getTagProperty().hasAttribute(
SUMO_ATTR_END) && GNEAttributeCarrier::canParse<double>(additional->getAttribute(
SUMO_ATTR_END))) {
495 sortedChildren.back().first.second = additional->getAttributeDouble(
SUMO_ATTR_END);
497 sortedChildren.back().first.second = sortedChildren.back().first.first;
501 std::sort(sortedChildren.begin(), sortedChildren.end());
504 if (sortedChildren.size() <= 1) {
508 for (
int i = 0; i < (int)sortedChildren.size() - 1; i++) {
509 if (sortedChildren.at(i).first.second > sortedChildren.at(i + 1).first.first) {
516 throw ProcessError(
"Some child additional 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 belongs to GNENet but has influency in the simulation.
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
An Element which don't belongs to GNENet but has influency 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 & getParents() const
get parents
void addChildElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
add child element
const T & getChildren() const
get children
void removeParentElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
remove parent element
void removeChildElement(const GNEHierarchicalElement *hierarchicalElement, T *element)
remove child element
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
void addChildElement(T *element)
add child element
const std::vector< GNETAZElement * > & getChildTAZElements() const
get child TAZElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
~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< 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< GNEShape * > & getParentShapes() const
get parent shapes
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
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< GNEShape * > &parentShapes, const std::vector< GNETAZElement * > &parentTAZElements, const std::vector< GNEDemandElement * > &parentDemandElements, const std::vector< GNEGenericData * > &parentGenericDatas)
Constructor.
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEShape * > & getChildShapes() const
get child shapes
const std::vector< GNETAZElement * > & getParentTAZElements() const
get parent TAZElements
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.
const std::string & getID() const
get ID
An Element which don't belongs to GNENet but has influency in the simulation.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property