51 #ifdef CHECK_MEMORY_LEAKS
53 #endif // CHECK_MEMORY_LEAKS
67 const std::string& name,
72 : myID(id), myNode(-1), myName(name), myEdge(edge), myDisturbance(by),
73 myTimeGap(timegap), myWayGap(waygap), myVMax(vmax) {}
82 const std::string& name,
99 DictType::iterator i =
myDict.find(
id);
110 DictType::iterator i =
myDict.find(
id);
119 std::vector<int> ret;
120 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
121 if ((*i).second->crosses(poly)) {
122 ret.push_back((*i).second->myID);
153 if (pc == 0 && bc == 0) {
160 WRITE_WARNING(
"Ugly split to prohibit '" + toString<int>(e1->
getID()) +
"' by '" + toString<int>(e2->getID()) +
"'.");
162 std::string id1 = toString<int>(e1->
getID()) +
"x" + toString<int>(e2->getID());
163 std::string id2 = toString<int>(e2->getID()) +
"x" + toString<int>(e1->
getID());
167 assert(node1 == 0 || node2 == 0);
168 if (node1 == 0 && node2 == 0) {
177 node = node1 == 0 ? node2 : node1;
185 NBEdge* mustStopFrom = ec.
retrieve(toString<int>(e2->getID()) +
"[0]");
186 NBEdge* mustStopTo = ec.
retrieve(toString<int>(e2->getID()) +
"[1]");
187 if (mayDriveFrom != 0 && mayDriveTo != 0 && mustStopFrom != 0 && mustStopTo != 0) {
197 }
else if (pc != 0 && bc == 0) {
217 std::string id_pcie = toString<int>(pc->
getToEdgeID());
226 for (EdgeVector::const_iterator i = connected.begin(); i != connected.end(); i++) {
232 WRITE_WARNING(
"Would have to split edge '" + e->
getID() +
"' to build a prohibition");
251 }
else if (bc != 0 && pc == 0) {
262 std::string nid1 = e->
getID() +
"[0]";
263 std::string nid2 = e->
getID() +
"[1]";
271 std::string id_bcoe = toString<int>(bc->getFromEdgeID());
272 std::string id_bcie = toString<int>(bc->getToEdgeID());
281 for (EdgeVector::const_iterator i = connected.begin(); i != connected.end(); i++) {
287 WRITE_WARNING(
"Would have to split edge '" + e->
getID() +
"' to build a prohibition");
309 if (!conn1.
check(ec) || !conn2.check(ec)) {
341 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
350 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
static bool dictionary(int id, NIVissimAbstractEdge *e)
static std::vector< int > getWithin(const AbstractPoly &poly)
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.
NBEdge * retrievePossiblySplit(const std::string &id, const std::string &hint, bool incoming) const
Tries to retrieve an edge, even if it is splitted.
virtual ~NIVissimDisturbance()
static void reportRefused()
int getFromEdgeID() const
NBNode * getFromNode() const
Returns the origin node of the edge.