51 #ifdef CHECK_MEMORY_LEAKS
53 #endif // CHECK_MEMORY_LEAKS
69 const std::string& name,
74 : myID(id), myNode(-1), myName(name), myEdge(edge), myDisturbance(by),
75 myTimeGap(timegap), myWayGap(waygap), myVMax(vmax) {}
84 const std::string& name,
101 DictType::iterator i =
myDict.find(
id);
112 DictType::iterator i =
myDict.find(
id);
121 std::vector<int> ret;
122 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
123 if ((*i).second->crosses(poly)) {
124 ret.push_back((*i).second->myID);
155 if (pc == 0 && bc == 0) {
162 WRITE_WARNING(
"Ugly split to prohibit '" + toString<int>(e1->
getID()) +
"' by '" + toString<int>(e2->getID()) +
"'.");
164 std::string id1 = toString<int>(e1->
getID()) +
"x" + toString<int>(e2->getID());
165 std::string id2 = toString<int>(e2->getID()) +
"x" + toString<int>(e1->
getID());
169 assert(node1 == 0 || node2 == 0);
170 if (node1 == 0 && node2 == 0) {
179 node = node1 == 0 ? node2 : node1;
187 NBEdge* mustStopFrom = ec.
retrieve(toString<int>(e2->getID()) +
"[0]");
188 NBEdge* mustStopTo = ec.
retrieve(toString<int>(e2->getID()) +
"[1]");
189 if (mayDriveFrom != 0 && mayDriveTo != 0 && mustStopFrom != 0 && mustStopTo != 0) {
199 }
else if (pc != 0 && bc == 0) {
219 std::string id_pcie = toString<int>(pc->
getToEdgeID());
228 for (EdgeVector::const_iterator i = connected.begin(); i != connected.end(); i++) {
234 WRITE_WARNING(
"Would have to split edge '" + e->
getID() +
"' to build a prohibition");
253 }
else if (bc != 0 && pc == 0) {
264 std::string nid1 = e->
getID() +
"[0]";
265 std::string nid2 = e->
getID() +
"[1]";
273 std::string id_bcoe = toString<int>(bc->getFromEdgeID());
274 std::string id_bcie = toString<int>(bc->getToEdgeID());
283 for (EdgeVector::const_iterator i = connected.begin(); i != connected.end(); i++) {
289 WRITE_WARNING(
"Would have to split edge '" + e->
getID() +
"' to build a prohibition");
311 if (!conn1.
check(ec) || !conn2.check(ec)) {
343 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
352 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
bool check(const NBEdgeCont &ec)
checks whether the edges are still valid
Position getGeomPosition() const
NBEdge * retrievePossiblySplit(const std::string &id, bool downstream) const
Tries to retrieve an edge, even if it is splitted.
static bool dictionary(int id, NIVissimAbstractEdge *e)
static std::vector< int > getWithin(const AbstractPoly &poly)
static const NBConnection InvalidConnection
The representation of a single edge during network building.
SUMOReal xmin() const
Returns minimum x-coordinate.
A container for districts.
bool addToNode(NBNode *node, NBDistrictCont &dc, NBNodeCont &nc, NBEdgeCont &ec)
SUMOReal getPosition() const
bool splitAt(NBDistrictCont &dc, NBEdge *edge, NBNode *node)
Splits the edge at the position nearest to the given node.
#define UNUSED_PARAMETER(x)
SUMOReal xmax() const
Returns maximum x-coordinate.
A class that stores a 2D geometrical boundary.
#define WRITE_WARNING(msg)
static int refusedProhibits
A temporary storage for edges imported from Vissim.
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
NIVissimExtendedEdgePoint myEdge
const std::string & getID() const
Returns the id.
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
A point in 2D or 3D with translation and scaling methods.
Storage for edges, including some functionality operating on multiple edges.
static bool dictionary(int id, const std::string &name, const NIVissimExtendedEdgePoint &edge, const NIVissimExtendedEdgePoint &by, SUMOReal timegap, SUMOReal waygap, SUMOReal vmax)
std::map< int, NIVissimDisturbance * > DictType
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
NBNode * getToNode() const
Returns the destination node of the edge.
NBConnection getConnection(NBNode *node, int aedgeid)
NIVissimDisturbance(int id, const std::string &name, const NIVissimExtendedEdgePoint &edge, const NIVissimExtendedEdgePoint &by, SUMOReal timegap, SUMOReal waygap, SUMOReal vmax)
NIVissimExtendedEdgePoint myDisturbance
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
std::vector< NBEdge * > EdgeVector
static bool dictionary(int id, const std::string &name, const NIVissimExtendedEdgePoint &from_def, const NIVissimExtendedEdgePoint &to_def, const PositionVector &geom, Direction direction, SUMOReal dxnothalt, SUMOReal dxeinordnen, SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal seglength, const std::vector< int > &assignedVehicles, const NIVissimClosedLanesVector &clv)
static bool dictionary(int id, const std::string &name, const std::string &type, int noLanes, SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
Adds the described item to the dictionary Builds the edge first.
Represents a single node (junction) during network building.
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
static void dict_SetDisturbances()
Position crossesEdgeAtPoint(NIVissimAbstractEdge *c) const
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
Container for nodes during the netbuilding process.
virtual ~NIVissimDisturbance()
static void reportRefused()
int getFromEdgeID() const
NBNode * getFromNode() const
Returns the origin node of the edge.