92 ret.push_back((*i)->getID());
93 (*i)->setNodeCluster(
id);
114 const std::vector<int>& connections,
int nodeCluster,
int edgeid)
124 for (std::vector<int>::const_iterator i = connections.begin(); i != connections.end(); i++) {
137 const std::vector<int>& connections,
const Boundary& boundary,
138 int nodeCluster,
const std::vector<int>& edges)
139 : myConnections(connections), myBoundary(boundary),
140 myNodeCluster(nodeCluster), myEdges(edges) {
145 for (std::vector<int>::const_iterator i = connections.begin(); i != connections.end(); i++) {
150 assert(find(edges.begin(), edges.end(), c->
getFromEdgeID()) != edges.end()
152 std::find(edges.begin(), edges.end(), c->
getToEdgeID()) != edges.end());
171 double offset)
const {
193 for (std::vector<int>::iterator j = c->
myEdges.begin(); j != c->
myEdges.end(); j++) {
214 std::vector<NIVissimConnectionCluster*> joinAble;
220 ContType::iterator j = i + 1;
225 if ((*i)->joinable(*j, offset)) {
226 joinAble.push_back(*j);
230 for (std::vector<NIVissimConnectionCluster*>::iterator k = joinAble.begin();
231 k != joinAble.end(); k++) {
239 if (joinAble.size() > 0) {
252 ContType::iterator j = i + 1;
256 if ((*i)->joinable(*j, offset)) {
257 joinAble.push_back(*j);
261 for (std::vector<NIVissimConnectionCluster*>::iterator k = joinAble.begin();
262 k != joinAble.end(); k++) {
270 if (joinAble.size() > 0) {
286 ContType::iterator j = i + 1;
290 if ((*i)->isWeakDistrictConnRealisation(*j)) {
291 joinAble.push_back(*j);
295 for (std::vector<NIVissimConnectionCluster*>::iterator k = joinAble.begin();
296 k != joinAble.end(); k++) {
304 if (joinAble.size() > 0) {
344 std::vector<int> extendedOutgoing1;
345 std::vector<int> extendedIncoming1;
346 std::vector<int> extendedOutgoing2;
347 std::vector<int> extendedIncoming2;
388 bool crosses =
false;
410 if (oe ==
nullptr || ie ==
nullptr) {
431 if (pos1 <= 5.0 && pos2 <= 5.0) {
442 if (pos1 >= g.length() - 5.0 && pos2 >= g.length() - 5.0) {
454 const std::vector<int>& iv2)
const {
455 std::vector<int> ret(iv1);
456 for (std::vector<int>::const_iterator i = iv1.begin(); i != iv1.end(); i++) {
459 for (std::vector<NIVissimEdge*>::const_iterator j = treatAsSame.begin(); j != treatAsSame.end(); j++) {
460 if (find(iv2.begin(), iv2.end(), (*j)->getID()) == iv2.end()) {
461 ret.push_back((*j)->getID());
470 std::vector<int> ret;
474 for (std::vector<int>::const_iterator j = disturbances.begin(); j != disturbances.end(); j++) {
487 std::vector<int> disturbances;
488 std::vector<int> tls;
489 std::vector<int> nodes;
492 if ((*i)->myConnections.size() > 0) {
493 (*i)->recomputeBoundary();
496 nodes = (*i)->myNodes;
497 if (nodes.size() > 1) {
498 WRITE_WARNING(
"NIVissimConnectionCluster:More than a single node");
501 if (nodes.size() > 0) {
507 nodeid, tlsid, (*i)->myConnections,
508 disturbances, (*i)->myIncomingEdges.size() < 2);
509 assert((*i)->myNodeCluster ==
id || (*i)->myNodeCluster < 0);
510 (*i)->myNodeCluster = id;
518 std::vector<int> connections = (*i)->myConnections;
519 for (std::vector<int>::iterator j = connections.begin(); j != connections.end(); j++) {
520 if (j != connections.begin()) {
525 into <<
"(" << (*i)->myBoundary <<
")" << std::endl;
527 into <<
"---------------------------" << std::endl;
548 int connid = conn->
getID();
593 std::vector<int>::iterator i;
626 std::vector<int>::const_iterator i;
639 return sum / (double) part;
648 if (node !=
nullptr) {
670 WRITE_WARNING(
"NIVissimConnectionCluster: how to get an edge's position?");
674 std::vector<int>::const_iterator i = std::find(
myEdges.begin(),
myEdges.end(), edgeid);
682 edgeGeom.front(), edgeGeom.back(), p);
700 std::vector<NIVissimConnection*> edgeIsIncoming;
704 edgeIsIncoming.push_back(c);
708 if (edgeIsIncoming.size() == 0) {
712 sort(edgeIsIncoming.begin(), edgeIsIncoming.end(),
723 std::vector<NIVissimConnection*> edgeIsIncoming;
727 edgeIsIncoming.push_back(c);
731 if (edgeIsIncoming.size() == 0) {
735 sort(edgeIsIncoming.begin(), edgeIsIncoming.end(),
737 return *(edgeIsIncoming.begin());
745 std::vector<NIVissimConnection*> edgeIsOutgoing;
749 edgeIsOutgoing.push_back(c);
753 if (edgeIsOutgoing.size() == 0) {
757 sort(edgeIsOutgoing.begin(), edgeIsOutgoing.end(),
767 std::vector<NIVissimConnection*> edgeIsOutgoing;
771 edgeIsOutgoing.push_back(c);
775 if (edgeIsOutgoing.size() == 0) {
779 sort(edgeIsOutgoing.begin(), edgeIsOutgoing.end(),
781 return *(edgeIsOutgoing.begin());