58 const std::string& name,
61 : myID(id), myNode(-1), myName(name), myEdge(edge), myDisturbance(by) {}
84 DictType::iterator i =
myDict.find(
id);
95 DictType::iterator i =
myDict.find(
id);
104 std::vector<int> ret;
105 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
106 if ((*i).second->crosses(poly)) {
107 ret.push_back((*i).second->myID);
138 if (pc ==
nullptr && bc ==
nullptr) {
145 WRITE_WARNING(
"Ugly split to prohibit '" + toString<int>(e1->
getID()) +
"' by '" + toString<int>(e2->getID()) +
"'.");
147 std::string id1 = toString<int>(e1->
getID()) +
"x" + toString<int>(e2->getID());
148 std::string id2 = toString<int>(e2->getID()) +
"x" + toString<int>(e1->
getID());
152 assert(node1 == 0 || node2 == 0);
153 if (node1 ==
nullptr && node2 ==
nullptr) {
162 node = node1 ==
nullptr ? node2 : node1;
170 NBEdge* mustStopFrom = ec.
retrieve(toString<int>(e2->getID()) +
"[0]");
171 NBEdge* mustStopTo = ec.
retrieve(toString<int>(e2->getID()) +
"[1]");
172 if (mayDriveFrom !=
nullptr && mayDriveTo !=
nullptr && mustStopFrom !=
nullptr && mustStopTo !=
nullptr) {
182 }
else if (pc !=
nullptr && bc ==
nullptr) {
202 std::string id_pcie = toString<int>(pc->
getToEdgeID());
211 for (EdgeVector::const_iterator i = connected.begin(); i != connected.end(); i++) {
217 WRITE_WARNING(
"Would have to split edge '" + e->
getID() +
"' to build a prohibition");
236 }
else if (bc !=
nullptr && pc ==
nullptr) {
247 std::string nid1 = e->
getID() +
"[0]";
248 std::string nid2 = e->
getID() +
"[1]";
256 std::string id_bcoe = toString<int>(bc->getFromEdgeID());
257 std::string id_bcie = toString<int>(bc->getToEdgeID());
266 for (EdgeVector::const_iterator i = connected.begin(); i != connected.end(); i++) {
272 WRITE_WARNING(
"Would have to split edge '" + e->
getID() +
"' to build a prohibition");
294 if (!conn1.
check(ec) || !conn2.check(ec)) {
326 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
335 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
bool check(const NBEdgeCont &ec)
checks whether the edges are still valid
double xmax() const
Returns maximum x-coordinate.
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.
A container for districts.
static bool dictionary(const std::string &name, const NIVissimExtendedEdgePoint &edge, const NIVissimExtendedEdgePoint &by)
bool addToNode(NBNode *node, NBDistrictCont &dc, NBNodeCont &nc, NBEdgeCont &ec)
bool splitAt(NBDistrictCont &dc, NBEdge *edge, NBNode *node)
Splits the edge at the position nearest to the given node.
static bool dictionary(int id, NIVissimConnection *o)
const std::string & getID() const
Returns the id.
A class that stores a 2D geometrical boundary.
#define WRITE_WARNING(msg)
static int refusedProhibits
A temporary storage for edges imported from Vissim.
NIVissimExtendedEdgePoint myEdge
int getFromEdgeID() const
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
get possibly splitted incoming edge
NBEdge * retrievePossiblySplit(const std::string &id, bool downstream) const
Tries to retrieve an edge, even if it is splitted.
A point in 2D or 3D with translation and scaling methods.
Storage for edges, including some functionality operating on multiple edges.
double xmin() const
Returns minimum x-coordinate.
static bool dictionary(int id, const std::string &name, const std::string &type, int noLanes, double zuschlag1, double zuschlag2, double length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
Adds the described item to the dictionary Builds the edge first.
std::map< int, NIVissimDisturbance * > DictType
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
get possibly splitted outgoing edge
Position crossesEdgeAtPoint(NIVissimAbstractEdge *c) const
NBConnection getConnection(NBNode *node, int aedgeid)
NIVissimExtendedEdgePoint myDisturbance
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
double getPosition() const
Represents a single node (junction) during network building.
NIVissimDisturbance(int id, const std::string &name, const NIVissimExtendedEdgePoint &edge, const NIVissimExtendedEdgePoint &by)
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
add shorted link FOES
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
static void dict_SetDisturbances()
NBNode * getFromNode() const
Returns the origin node of the edge.
Container for nodes during the netbuilding process.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
virtual ~NIVissimDisturbance()
Position getGeomPosition() const
NBNode * getToNode() const
Returns the destination node of the edge.
static void reportRefused()