Exemplo n.º 1
0
void
RODFNet::buildApproachList() {
    const std::map<std::string, ROEdge*>& edges = getEdgeMap();
    for (std::map<std::string, ROEdge*>::const_iterator rit = edges.begin(); rit != edges.end(); ++rit) {
        ROEdge* ce = (*rit).second;
        unsigned int i = 0;
        unsigned int length_size = ce->getNoFollowing();
        for (i = 0; i < length_size; i++) {
            ROEdge* help = ce->getFollower(i);
            if (find(myDisallowedEdges.begin(), myDisallowedEdges.end(), help->getID()) != myDisallowedEdges.end()) {
                // edges in sinks will not be used
                continue;
            }
            if (!myKeepTurnarounds && help->getToNode() == ce->getFromNode()) {
                // do not use turnarounds
                continue;
            }
            // add the connection help->ce to myApproachingEdges
            if (myApproachingEdges.find(help) == myApproachingEdges.end()) {
                myApproachingEdges[help] = std::vector<ROEdge*>();
            }
            myApproachingEdges[help].push_back(ce);
            // add the connection ce->help to myApproachingEdges
            if (myApproachedEdges.find(ce) == myApproachedEdges.end()) {
                myApproachedEdges[ce] = std::vector<ROEdge*>();
            }
            myApproachedEdges[ce].push_back(help);
        }
    }
}
Exemplo n.º 2
0
void
RODFNet::buildApproachList() {
    const std::map<std::string, ROEdge*>& edges = getEdgeMap();
    for (std::map<std::string, ROEdge*>::const_iterator rit = edges.begin(); rit != edges.end(); ++rit) {
        ROEdge* ce = (*rit).second;
        const ROEdgeVector& successors = ce->getSuccessors();
        for (ROEdgeVector::const_iterator it = successors.begin(); it != successors.end(); ++it) {
            ROEdge* help = *it;
            if (find(myDisallowedEdges.begin(), myDisallowedEdges.end(), help->getID()) != myDisallowedEdges.end()) {
                // edges in sinks will not be used
                continue;
            }
            if (!myKeepTurnarounds && help->getToNode() == ce->getFromNode()) {
                // do not use turnarounds
                continue;
            }
            // add the connection help->ce to myApproachingEdges
            if (myApproachingEdges.find(help) == myApproachingEdges.end()) {
                myApproachingEdges[help] = ROEdgeVector();
            }
            myApproachingEdges[help].push_back(ce);
            // add the connection ce->help to myApproachingEdges
            if (myApproachedEdges.find(ce) == myApproachedEdges.end()) {
                myApproachedEdges[ce] = ROEdgeVector();
            }
            myApproachedEdges[ce].push_back(help);
        }
    }
}