48 myAllowUndoShapes(true) {
51 for (
const auto& additionalTag : additionalTags) {
52 myAdditionals.insert(std::make_pair(additionalTag.first, std::map<std::string, GNEAdditional*>()));
56 for (
const auto& shapeTag : shapeTags) {
57 myShapes.insert(std::make_pair(shapeTag.first, std::map<std::string, GNEShape*>()));
61 for (
const auto& TAZElementTag : TAZElementTags) {
62 myTAZElements.insert(std::make_pair(TAZElementTag.first, std::map<std::string, GNETAZElement*>()));
66 for (
const auto& demandElementTag : demandElementTags) {
67 myDemandElements.insert(std::make_pair(demandElementTag.first, std::map<std::string, GNEDemandElement*>()));
70 for (
const auto& stopTag : stopTags) {
71 myDemandElements.insert(std::make_pair(stopTag.first, std::map<std::string, GNEDemandElement*>()));
78 for (
const auto& edgeType : myEdgeTypes) {
79 edgeType.second->decRef(
"GNENetHelper::~GNENet");
81 WRITE_DEBUG(
"Deleting unreferenced " + edgeType.second->getTagStr() +
" '" + edgeType.second->getID() +
"' in AttributeCarriers destructor");
82 delete edgeType.second;
85 for (
const auto& edge : myEdges) {
86 edge.second->decRef(
"GNENetHelper::~GNENet");
88 WRITE_DEBUG(
"Deleting unreferenced " + edge.second->getTagStr() +
" '" + edge.second->getID() +
"' in AttributeCarriers destructor");
92 for (
const auto& junction : myJunctions) {
93 junction.second->decRef(
"GNENetHelper::~GNENet");
95 WRITE_DEBUG(
"Deleting unreferenced " + junction.second->getTagStr() +
" '" + junction.second->getID() +
"' in AttributeCarriers destructor");
96 delete junction.second;
99 for (
const auto& additionalTag : myAdditionals) {
100 for (
const auto& additional : additionalTag.second) {
102 additional.second->decRef();
104 WRITE_DEBUG(
"Deleting unreferenced " + additional.second->getTagStr() +
" '" + additional.second->getID() +
"' in AttributeCarriers destructor");
105 delete additional.second;
109 for (
const auto& shapeTag : myShapes) {
110 for (
const auto& shape : shapeTag.second) {
112 shape.second->decRef();
114 WRITE_DEBUG(
"Deleting unreferenced " + shape.second->getTagStr() +
" '" + shape.second->getID() +
"' in AttributeCarriers destructor");
119 for (
const auto& demandElementTag : myDemandElements) {
120 for (
const auto& demandElement : demandElementTag.second) {
122 demandElement.second->decRef();
124 WRITE_DEBUG(
"Deleting unreferenced " + demandElement.second->getTagStr() +
" '" + demandElement.second->getID() +
"' in AttributeCarriers destructor");
125 delete demandElement.second;
134 updateJunctionID(AC, newID);
136 updateEdgeID(AC, newID);
138 updateEdgeTypeID(AC, newID);
140 updateAdditionalID(AC, newID);
142 updateShapeID(AC, newID);
144 updateTAZElementID(AC, newID);
146 updateDemandElementID(AC, newID);
148 updateDataSetID(AC, newID);
157 std::map<std::string, GNEEdge*> newEdgeMap;
158 std::map<std::string, GNEJunction*> newJunctionMap;
160 for (
const auto& edge : myEdges) {
161 edge.second->setMicrosimID(edge.second->getNBEdge()->getID());
162 newEdgeMap[edge.second->getNBEdge()->getID()] = edge.second;
164 for (
const auto& junction : myJunctions) {
165 newJunctionMap[junction.second->getNBNode()->getID()] = junction.second;
166 junction.second->setMicrosimID(junction.second->getNBNode()->getID());
168 myEdges = newEdgeMap;
169 myJunctions = newJunctionMap;
176 junction->
incRef(
"GNENet::registerJunction");
182 myNet->addGLObjectIntoGrid(junction);
191 const std::map<std::string, GNEJunction*>&
206 edgeType->
incRef(
"GNENet::registerEdgeType");
213 const std::map<std::string, GNEEdgeType*>&
226 edge->
incRef(
"GNENet::registerEdge");
233 myNet->addGLObjectIntoGrid(edge);
241 const std::map<std::string, GNEEdge*>&
254 const std::string& imgFile,
bool relativePath,
const PositionVector& shape,
bool geo,
bool fill,
double lineWidth,
bool ) {
258 GNEPoly* poly =
new GNEPoly(myNet,
id, type, shape, geo, fill, lineWidth, color, layer, angle, imgFile, relativePath,
false,
false);
259 if (myAllowUndoShapes) {
261 myNet->getViewNet()->getUndoList()->add(
new GNEChange_Shape(poly,
true),
true);
262 myNet->getViewNet()->getUndoList()->p_end();
266 poly->
incRef(
"addPolygon");
277 const std::string& lane,
double posOverLane,
double posLat,
double layer,
double angle,
278 const std::string& imgFile,
bool relativePath,
double width,
double height,
bool ) {
284 GNEPOI*
POI =
new GNEPOI(myNet,
id, type, color, pos, geo, layer, angle, imgFile, relativePath, width, height,
false);
285 if (myAllowUndoShapes) {
286 myNet->getViewNet()->getUndoList()->p_begin(
"add " +
POI->getTagStr());
288 myNet->getViewNet()->getUndoList()->p_end();
292 POI->incRef(
"addPOI");
297 GNELane* retrievedLane = myNet->retrieveLane(lane,
false);
298 if (retrievedLane ==
nullptr) {
299 WRITE_ERROR(
"invalid lane to use within POI " +
id);
301 GNEShape* POILane =
new GNEPOI(myNet,
id, type, color, layer, angle, imgFile, relativePath, retrievedLane, posOverLane, posLat, width, height,
false);
302 if (myAllowUndoShapes) {
303 myNet->getViewNet()->getUndoList()->p_begin(
"add " + POILane->
getTagStr());
304 myNet->getViewNet()->getUndoList()->add(
new GNEChange_Shape(POILane,
true),
true);
305 myNet->getViewNet()->getUndoList()->p_end();
308 insertShape(POILane);
310 POILane->
incRef(
"addPOILane");
321 const std::map<SumoXMLTag, std::map<std::string, GNEAdditional*> >&
323 return myAdditionals;
330 for (
const auto& additionalsTags : myAdditionals) {
331 for (
const auto& additional : additionalsTags.second) {
332 myNet->removeGLObjectFromGrid(additional.second);
336 for (
auto& additionals : myAdditionals) {
337 additionals.second.clear();
342 const std::map<SumoXMLTag, std::map<std::string, GNEShape*> >&
351 for (
const auto& shapesTags : myShapes) {
352 for (
const auto& shape : shapesTags.second) {
353 myNet->removeGLObjectFromGrid(shape.second);
357 for (
auto& shapes : myShapes) {
358 shapes.second.clear();
363 const std::map<SumoXMLTag, std::map<std::string, GNETAZElement*> >&
365 return myTAZElements;
372 for (
const auto& TAZElementsTags : myTAZElements) {
373 for (
const auto& TAZElement : TAZElementsTags.second) {
374 myNet->removeGLObjectFromGrid(TAZElement.second);
378 for (
auto& TAZElements : myTAZElements) {
379 TAZElements.second.clear();
384 const std::map<SumoXMLTag, std::map<std::string, GNEDemandElement*> >&
386 return myDemandElements;
393 for (
const auto& demandElementsTags : myDemandElements) {
394 for (
const auto& demandElement : demandElementsTags.second) {
395 myNet->removeGLObjectFromGrid(demandElement.second);
399 for (
auto& demandElements : myDemandElements) {
400 demandElements.second.clear();
409 myDemandElements.at(defaultVehicleType->
getTagProperty().
getTag()).insert(std::make_pair(defaultVehicleType->
getID(), defaultVehicleType));
410 defaultVehicleType->
incRef(
"GNENet::DEFAULT_VEHTYPE");
414 myDemandElements.at(defaultBikeType->
getTagProperty().
getTag()).insert(std::make_pair(defaultBikeType->
getID(), defaultBikeType));
415 defaultBikeType->
incRef(
"GNENet::DEFAULT_BIKETYPE_ID");
419 myDemandElements.at(defaultPersonType->
getTagProperty().
getTag()).insert(std::make_pair(defaultPersonType->
getID(), defaultPersonType));
420 defaultPersonType->
incRef(
"GNENet::DEFAULT_PEDTYPE_ID");
424 const std::map<std::string, GNEDataSet*>&
433 for (
const auto& dataSet : myDataSets) {
434 for (
const auto& dataInterval : dataSet.second->getDataIntervalChildren()) {
435 for (
const auto& genericData : dataInterval.second->getGenericDataChildren()) {
436 myNet->removeGLObjectFromGrid(genericData);
445 std::vector<GNEGenericData*>
448 std::vector<GNEGenericData*> genericDatas;
450 for (
const auto& dataSet : myDataSets) {
451 for (
const auto& interval : dataSet.second->getDataIntervalChildren()) {
455 for (
const auto& genericData : interval.second->getGenericDataChildren()) {
456 if (genericData->getTagProperty().getTag() == genericDataTag) {
457 genericDatas.push_back(genericData);
469 myNet->getNetBuilder()->getNodeCont().insert(junction->
getNBNode());
470 registerJunction(junction);
477 myNet->getViewNet()->removeFromAttributeCarrierInspected(junction);
478 myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(junction);
480 myNet->removeGLObjectFromGrid(junction);
482 myNet->getNetBuilder()->getNodeCont().extract(junction->
getNBNode());
483 junction->
decRef(
"GNENet::deleteSingleJunction");
490 if (myJunctions.count(AC->
getID()) == 0) {
492 }
else if (myJunctions.count(newID) != 0) {
493 throw ProcessError(
"There is another " + AC->
getTagStr() +
" with new ID='" + newID +
"' in myJunctions");
500 myNet->getNetBuilder()->getNodeCont().rename(junction->
getNBNode(), newID);
504 myJunctions[AC->
getID()] = junction;
508 myNet->requireSaveNet(
true);
515 return (myEdgeTypes.count(edgeType->
getID()) > 0);
524 if (myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->shown()) {
525 myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->refreshEdgeTypeSelector();
533 myNet->getViewNet()->removeFromAttributeCarrierInspected(edgeType);
534 myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(edgeType);
538 if (myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->getEdgeTypeSelected() == edgeType) {
539 myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->clearEdgeTypeSelected();
540 myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->refreshEdgeTypeSelector();
543 if (myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->shown()) {
544 myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->refreshEdgeTypeSelector();
551 if (myEdgeTypes.count(AC->
getID()) == 0) {
553 }
else if (myEdgeTypes.count(newID) != 0) {
554 throw ProcessError(
"There is another " + AC->
getTagStr() +
" with new ID='" + newID +
"' in myEdgeTypes");
559 myEdgeTypes.erase(edgeType->
getID());
561 myNet->getNetBuilder()->getTypeCont().updateEdgeTypeID(edgeType->
getID(), newID);
565 myEdgeTypes[AC->
getID()] = edgeType;
567 myNet->requireSaveNet(
true);
575 myNet->getNetBuilder()->getEdgeCont().insert(nbe);
586 myNet->getViewNet()->removeFromAttributeCarrierInspected(edge);
587 myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(edge);
589 myNet->removeGLObjectFromGrid(edge);
592 myNet->getNetBuilder()->getEdgeCont().extract(myNet->getNetBuilder()->getDistrictCont(), edge->
getNBEdge());
593 edge->
decRef(
"GNENet::deleteSingleEdge");
603 if (myEdges.count(AC->
getID()) == 0) {
605 }
else if (myEdges.count(newID) != 0) {
606 throw ProcessError(
"There is another " + AC->
getTagStr() +
" with new ID='" + newID +
"' in myEdges");
613 myNet->getNetBuilder()->getEdgeCont().rename(edge->
getNBEdge(), newID);
617 myEdges[AC->
getID()] = edge;
619 for (
const auto& lane : edge->
getLanes()) {
620 lane->updateConnectionIDs();
623 myNet->requireSaveNet(
true);
645 if (!additionalExist(additional)) {
654 myNet->addGLObjectIntoGrid(additional);
657 if (myNet->isUpdateGeometryEnabled()) {
661 myNet->requireSaveAdditionals(
true);
670 if (additionalExist(additional)) {
672 myNet->getViewNet()->removeFromAttributeCarrierInspected(additional);
673 myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(additional);
683 myNet->removeGLObjectFromGrid(additional);
686 myNet->requireSaveAdditionals(
true);
695 throw ProcessError(
"There is another " + AC->
getTagStr() +
" with new ID='" + newID +
"' in AttributeCarriers.additionals");
706 myNet->requireSaveAdditionals(
true);
717 return myShapes.at(shapeTag).find(shape->
getID()) != myShapes.at(shapeTag).end();
729 if (!shapeExist(shape)) {
730 myShapes.at(shapeTag).insert(std::make_pair(shape->
getID(), shape));
732 myNet->addGLObjectIntoGrid(shape);
734 if (myNet->isUpdateGeometryEnabled()) {
738 myNet->requireSaveAdditionals(
true);
750 if (shapeExist(shape)) {
752 myNet->getViewNet()->removeFromAttributeCarrierInspected(shape);
753 myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(shape);
755 auto it = myShapes.at(shapeTag).find(shape->
getID());
756 myShapes.at(shapeTag).erase(it);
758 myNet->removeGLObjectFromGrid(shape);
760 myNet->requireSaveAdditionals(
true);
772 if (myShapes.at(shapeTag).count(AC->
getID()) == 0) {
774 }
else if (myShapes.at(shapeTag).count(newID) != 0) {
775 throw ProcessError(
"There is another " + AC->
getTagStr() +
" with new ID='" + newID +
"' in AttributeCarriers.shapes");
780 myShapes.at(shapeTag).erase(shape->
getID());
784 myShapes.at(shapeTag).insert(std::make_pair(shape->
getID(), shape));
786 myNet->requireSaveAdditionals(
true);
806 if (!TAZElementExist(TAZElement)) {
809 myNet->addGLObjectIntoGrid(TAZElement);
811 if (myNet->isUpdateGeometryEnabled()) {
815 myNet->requireSaveAdditionals(
true);
825 if (TAZElementExist(TAZElement)) {
827 myNet->getViewNet()->removeFromAttributeCarrierInspected(TAZElement);
828 myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(TAZElement);
833 myNet->removeGLObjectFromGrid(TAZElement);
835 myNet->requireSaveAdditionals(
true);
847 throw ProcessError(
"There is another " + AC->
getTagStr() +
" with new ID='" + newID +
"' in AttributeCarriers.TAZElements");
858 myNet->requireSaveAdditionals(
true);
880 if (!demandElementExist(demandElement)) {
882 myDemandElements.at(demandElement->
getTagProperty().
getTag()).insert(std::make_pair(demandElement->
getID(), demandElement));
888 myNet->addGLObjectIntoGrid(demandElement);
890 if (myNet->isUpdateGeometryEnabled()) {
894 myNet->requireSaveDemandElements(
true);
904 if (demandElementExist(demandElement)) {
906 myNet->getViewNet()->removeFromAttributeCarrierInspected(demandElement);
907 myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(demandElement);
916 myNet->removeGLObjectFromGrid(demandElement);
918 myNet->requireSaveDemandElements(
true);
927 throw ProcessError(
"There is another " + AC->
getTagStr() +
" with new ID='" + newID +
"' in AttributeCarriers.myDemandElements");
945 myDemandElements.at(demandElement->
getTagProperty().
getTag()).insert(std::make_pair(demandElement->
getID(), demandElement));
953 myNet->requireSaveDemandElements(
true);
962 for (
const auto& dataset : myDataSets) {
963 if (dataset.second == dataSet) {
977 if (!dataSetExist(dataSet)) {
979 myDataSets.insert(std::make_pair(dataSet->
getID(), dataSet));
981 myNet->requireSaveDataElements(
true);
983 myNet->getViewNet()->getIntervalBar().updateIntervalBar();
993 if (dataSetExist(dataSet)) {
995 myNet->getViewNet()->removeFromAttributeCarrierInspected(dataSet);
996 myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(dataSet);
998 myDataSets.erase(myDataSets.find(dataSet->
getID()));
1000 myNet->requireSaveDataElements(
true);
1002 myNet->getViewNet()->getIntervalBar().updateIntervalBar();
1011 if (myDataSets.count(AC->
getID()) == 0) {
1013 }
else if (myDataSets.count(newID) != 0) {
1014 throw ProcessError(
"There is another " + AC->
getTagStr() +
" with new ID='" + newID +
"' in dataSets");
1019 myDataSets.erase(dataSet->
getID());
1023 myDataSets[dataSet->
getID()] = dataSet;
1025 myNet->requireSaveDataElements(
true);
1027 myNet->getViewNet()->getIntervalBar().updateIntervalBar();
1037 myDijkstraRouter(nullptr) {
1046 delete myDijkstraRouter;
1053 if (myDijkstraRouter) {
1054 delete myDijkstraRouter;
1057 myNet->getNetBuilder()->getEdgeCont().getAllRouterEdges(),
1062 std::vector<GNEEdge*>
1065 std::vector<GNEEdge*> solution;
1067 if (partialEdges.size() == 0) {
1071 if (partialEdges.size() == 1) {
1073 solution.push_back(partialEdges.front());
1076 NBVehicle tmpVehicle(
"temporalNBVehicle", vClass);
1078 GNENet* net = partialEdges.front()->getNet();
1080 for (
int i = 1; i < (int)partialEdges.size(); i++) {
1082 std::vector<const NBRouterEdge*> partialRoute;
1083 myDijkstraRouter->compute(partialEdges.at(i - 1)->getNBEdge(), partialEdges.at(i)->getNBEdge(), &tmpVehicle, 10, partialRoute);
1085 for (
const auto& edgeID : partialRoute) {
1086 solution.push_back(net->
retrieveEdge(edgeID->getID()));
1091 auto solutionIt = solution.begin();
1093 while (solutionIt != solution.end()) {
1094 if ((solutionIt + 1) != solution.end()) {
1096 if (*solutionIt == *(solutionIt + 1)) {
1097 solutionIt = solution.erase(solutionIt);
1113 for (
const auto& lane : edge.second->getLanes()) {
1114 lane->resetReachability();
1120 std::map<GNEEdge*, double> reachableEdges;
1122 reachableEdges[originEdge] = 0;
1124 std::vector<GNEEdge*> check;
1126 check.push_back(originEdge);
1128 while (check.size() > 0) {
1129 GNEEdge* edge = check.front();
1130 check.erase(check.begin());
1131 double traveltime = reachableEdges[edge];
1132 for (
const auto& lane : edge->
getLanes()) {
1139 std::vector<GNEEdge*> sucessors;
1141 for (
const auto& sucessorEdge : edge->
getParentJunctions().back()->getGNEOutgoingEdges()) {
1143 if (consecutiveEdgesConnected(vClass, edge, sucessorEdge)) {
1144 sucessors.push_back(sucessorEdge);
1148 for (
const auto& nextEdge : sucessors) {
1150 if ((reachableEdges.count(nextEdge) == 0) || (reachableEdges[nextEdge] > traveltime)) {
1151 reachableEdges[nextEdge] = traveltime;
1152 check.push_back(nextEdge);
1162 if ((from ==
nullptr) || (to ==
nullptr)) {
1165 }
else if (from == to) {
1173 for (
const auto& fromLane : from->
getLanes()) {
1176 for (
const auto& toLane : to->
getLanes()) {
1177 if (fromConnection->getLaneTo() == toLane) {
1182 if (((NBFromLane.
permissions & vClass) == vClass) &&
1201 if ((busStop->
getParentLanes().front()->getParentEdge() == edge) &&
1207 std::vector<GNELane*> pedestrianLanes;
1208 for (
int laneIndex = 0; laneIndex < (int)edge->
getLanes().size(); laneIndex++) {
1210 pedestrianLanes.push_back(edge->
getLanes().at(laneIndex));
1217 for (
const auto& lane : pedestrianLanes) {
1218 if (access->getParentLanes().front() == lane) {
1236 myReplaced(replaced),
1246 return "Redo replace in TLS";
1252 return "Undo replace in TLS";
1259 myTllcont.replaceRemoved(myBy, -1, myReplaced, -1,
true);
1266 myTllcont.replaceRemoved(myReplaced, -1, myBy, -1,
true);
1272 return myReplaced != myBy;
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_PEDESTRIAN
pedestrian
const std::string DEFAULT_PEDTYPE_ID
const std::string DEFAULT_VTYPE_ID
const std::string DEFAULT_BIKETYPE_ID
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_VTYPE
description of a vehicle type
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_POILANE
begin/end of the description of a Point of interest over Lane (used by Netedit)
@ SUMO_TAG_TYPE
type (edge)
@ SUMO_TAG_PTYPE
description of a person type (used in NETEDIT)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route (used in NETEDIT)
@ 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
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Computes the shortest path through a network using the Dijkstra algorithm.
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
virtual void updateGeometry()=0
update pre-computed geometry information
virtual const std::string & getID() const =0
return ID of object
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
static std::vector< std::pair< SumoXMLTag, const std::string > > getAllowedTagsByCategory(const int tagPropertyCategory, const bool onlyDrawables)
get tags of all editable element types using TagProperty Type (NetworkEditMode::NETWORKELEMENT,...
GNENet * getNet() const
get pointer to net
void setReachability(const double reachability)
set current reachability (traveltime)
the function-object for an editing operation (abstract base)
const std::string & getID() const
get ID
void setDataSetID(const std::string &newID)
set new ID in dataSet
An Element which don't belongs to GNENet but has influency in the simulation.
virtual void updateGeometry()=0
update pre-computed geometry information
const std::string & getID() const
get ID
A road/street connecting two junctions (netedit-version)
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
NBEdge * getNBEdge() const
returns the internal NBEdge
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
void setMicrosimID(const std::string &newID)
override to also set lane ids
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
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
void updateGeometry()
update pre-computed geometry information (including crossings)
NBNode * getNBNode() const
Return net build node.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const std::map< std::string, GNEDataSet * > & getDataSets() const
void deleteDataSet(GNEDataSet *dataSet)
delete demand element element of GNENet container
bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
GNEEdgeType * registerEdgeType(GNEEdgeType *edgeType)
void insertDataSet(GNEDataSet *dataSet)
Insert a demand element element int GNENet container.
void clearDemandElements()
clear demand elements
GNEEdge * registerEdge(GNEEdge *edge)
void updateEdgeTypeID(GNEAttributeCarrier *AC, const std::string &newID)
update edgeType ID in container
void updateDataSetID(GNEAttributeCarrier *AC, const std::string &newID)
update data element ID in container
void deleteShape(GNEShape *shape)
delete shape element of GNENet container
void remapJunctionAndEdgeIds()
remap junction and edge IDs
void clearEdgeTypes()
clear edgeTypes
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > myAdditionals
map with the ID and pointer to additional elements of net
void deleteDemandElement(GNEDemandElement *demandElement)
delete demand element element of GNENet container
void deleteEdgeType(GNEEdgeType *edgeType)
deletes edgeType
void clearAdditionals()
clear additionals
std::vector< GNEGenericData * > retrieveGenericDatas(const SumoXMLTag genericDataTag, const double begin, const double end)
bool demandElementExist(const GNEDemandElement *demandElement) const
return true if given demand element exist
void updateEdgeID(GNEAttributeCarrier *AC, const std::string &newID)
update edge ID in container
void deleteSingleJunction(GNEJunction *junction)
deletes a single junction
void insertShape(GNEShape *shape)
Insert a shape element int GNENet container.
GNEJunction * registerJunction(GNEJunction *junction)
bool dataSetExist(const GNEDataSet *dataSet) const
return true if given demand element exist
~AttributeCarriers()
destructor
void updateDemandElementID(GNEAttributeCarrier *AC, const std::string &newID)
update demand element ID in container
const std::map< std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
void deleteTAZElement(GNETAZElement *TAZElement)
delete TAZElement element of GNENet container
const std::map< SumoXMLTag, std::map< std::string, GNETAZElement * > > & getTAZElements() const
void addDefaultVTypes()
add default VTypes
void deleteSingleEdge(GNEEdge *edge)
deletes a single edge
void deleteAdditional(GNEAdditional *additional)
delete additional element of GNENet container
std::map< SumoXMLTag, std::map< std::string, GNEShape * > > myShapes
map with the ID and pointer to shape elements of net
void updateID(GNEAttributeCarrier *AC, const std::string newID)
update ID
void insertEdge(GNEEdge *edge)
void insertDemandElement(GNEDemandElement *demandElement)
Insert a demand element element int GNENet container.
void clearTAZElements()
clear TAZElements
bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath, const PositionVector &shape, bool geo, bool fill, double lineWidth, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
std::map< SumoXMLTag, std::map< std::string, GNETAZElement * > > myTAZElements
map with the ID and pointer to TAZElement elements of net
const std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > & getAdditionals() const
bool additionalExist(const GNEAdditional *additional) const
return true if given additional exist
bool shapeExist(const GNEShape *shape) const
return true if given shape exist
void insertTAZElement(GNETAZElement *TAZElement)
Insert a TAZElement element int GNENet container.
void insertAdditional(GNEAdditional *additional)
Insert a additional element int GNENet container.
void updateAdditionalID(GNEAttributeCarrier *AC, const std::string &newID)
update additional ID in container
void insertEdgeType(GNEEdgeType *edgeType)
inserts a single edgeType into the net and into the underlying netbuild-container
void clearDataSets()
clear demand elements
void clearEdges()
clear edges
void insertJunction(GNEJunction *junction)
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > myDemandElements
map with the ID and pointer to demand elements of net
const std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > & getDemandElements() const
const std::map< std::string, GNEJunction * > & getJunctions() const
map with the ID and pointer to junctions of net
const std::map< std::string, GNEEdgeType * > & getEdgeTypes() const
map with the ID and pointer to edgeTypes of net
bool TAZElementExist(const GNETAZElement *TAZElement) const
return true if given TAZElement exist
void clearJunctions()
clear junctions
void clearShapes()
clear shapes
void updateJunctionID(GNEAttributeCarrier *AC, const std::string &newID)
update junction ID in container
bool edgeTypeExist(const GNEEdgeType *edgeType) const
AttributeCarriers(GNENet *net)
constructor
const std::map< SumoXMLTag, std::map< std::string, GNEShape * > > & getShapes() const
void updateShapeID(GNEAttributeCarrier *AC, const std::string &newID)
update shape ID in container
void updateTAZElementID(GNEAttributeCarrier *AC, const std::string &newID)
update TAZElement ID in container
FXString undoName() const
undo name
FXString redoName() const
get Redo name
GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont &tllcont, NBEdge *replaced, NBEdge *by)
constructor
~GNEChange_ReplaceEdgeInTLS()
@bief destructor
bool trueChange()
wether original and new value differ
bool busStopConnected(const GNEAdditional *busStop, const GNEEdge *edge) const
check if exist a path between the given busStop and edge (Either a valid lane or an acces) for pedest...
void updatePathCalculator()
update path calculator (called when SuperModes Demand or Data is selected)
void calculateReachability(const SUMOVehicleClass vClass, GNEEdge *originEdge)
calculate reachability for given edge
PathCalculator(const GNENet *net)
constructor
SUMOAbstractRouter< NBRouterEdge, NBVehicle > * myDijkstraRouter
SUMO Abstract myDijkstraRouter.
std::vector< GNEEdge * > calculatePath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra path between a list of partial edges
const GNENet * myNet
pointer to net
bool consecutiveEdgesConnected(const SUMOVehicleClass vClass, const GNEEdge *from, const GNEEdge *to) const
check if exist a path between the two given consecutives edges for the given VClass
~PathCalculator()
destructor
A NBNetBuilder extended by visualisation and editing capabilities.
NBNetBuilder * getNetBuilder() const
get net builder
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const std::string & getID() const
get ID
void decRef(const std::string &debugMsg="")
Decrease reference.
void incRef(const std::string &debugMsg="")
Increarse reference.
virtual void updateGeometry()=0
update pre-computed geometry information
GUIGlObject * getGUIGlObject()
get GUIGlObject associated with this AttributeCarrier
const std::string & getID() const
get ID (all shapes have one)
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string & getID() const
get ID
virtual void updateGeometry()=0
update pre-computed geometry information
GUIGlObject * getGUIGlObject()
get GUIGlObject associated with this AttributeCarrier
bool isShape() const
return true if tag correspond to a shape
bool isTAZElement() const
return true if tag correspond to a TAZ element
bool isSlave() const
return true if tag correspond to an element slave of another element (I.e. doesn't have their own ID)
bool embebbedRoute() const
return true if tag correspond to an element that owns a embebbed route
bool isDataElement() const
return true if tag correspond to a data element
bool isPlacedInRTree() const
return true if Tag correspond to an element that has has to be placed in RTREE
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element
virtual 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.
RouterEdgeVector getAllRouterEdges() const
The representation of a single edge during network building.
double getLength() const
Returns the computed length of the edge.
const std::string & getID() const
NBNode * getToNode() const
Returns the destination node of the edge.
double getSpeed() const
Returns the speed allowed on this edge.
Lane & getLaneStruct(int lane)
NBNode * getFromNode() const
Returns the origin node of the edge.
NBEdgeCont & getEdgeCont()
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
int buildCrossings()
build pedestrian crossings
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
const Position & getPosition() const
static double getTravelTimeStatic(const NBRouterEdge *const edge, const NBVehicle *const, double)
A container for traffic light definitions and built programs.
A vehicle as used by router.
const std::string & getID() const
Returns the id.
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
double z() const
Returns the z-position.
An (internal) definition of a single lane of an edge.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
struct for default values that depend of VClass
double maxSpeed
The vehicle type's maximum speed [m/s].