void NBOwnTLDef::setTLControllingInformation(const NBEdgeCont&) const { // set the information about the link's positions within the tl into the // edges the links are starting at, respectively for (NBConnectionVector::const_iterator j = myControlledLinks.begin(); j != myControlledLinks.end(); ++j) { const NBConnection& conn = *j; NBEdge* edge = conn.getFrom(); edge->setControllingTLInformation(conn, getID()); } }
void NBOwnTLDef::setTLControllingInformation(const NBEdgeCont &) const throw() { // set the information about the link's positions within the tl into the // edges the links are starting at, respectively unsigned int pos = 0; for (NBConnectionVector::const_iterator j=myControlledLinks.begin(); j!=myControlledLinks.end(); ++j) { const NBConnection &conn = *j; NBEdge *edge = conn.getFrom(); if (edge->setControllingTLInformation(conn.getFromLane(), conn.getTo(), conn.getToLane(), getID(), pos)) { pos++; } } }
void NBLoadedSUMOTLDef::setTLControllingInformation() const { // if nodes have been removed our links may have been invalidated as well // since no logic will be built anyway there is no reason to inform any edges if (amInvalid()) { return; } // set the information about the link's positions within the tl into the // edges the links are starting at, respectively for (NBConnectionVector::const_iterator it = myControlledLinks.begin(); it != myControlledLinks.end(); it++) { const NBConnection& c = *it; assert(c.getTLIndex() < (int)myTLLogic->getNumLinks()); NBEdge* edge = c.getFrom(); edge->setControllingTLInformation(c, getID()); } }
void NBLoadedSUMOTLDef::setTLControllingInformation() const { // if nodes have been removed our links may have been invalidated as well // since no logic will be built anyway there is no reason to inform any edges if (amInvalid()) { return; } // set the information about the link's positions within the tl into the // edges the links are starting at, respectively for (NBConnectionVector::const_iterator it = myControlledLinks.begin(); it != myControlledLinks.end(); it++) { const NBConnection& c = *it; if (c.getTLIndex() >= (int)myTLLogic->getNumLinks()) { throw ProcessError("Invalid linkIndex " + toString(c.getTLIndex()) + " for traffic light '" + getID() + "' with " + toString(myTLLogic->getNumLinks()) + " links."); } NBEdge* edge = c.getFrom(); if (edge != 0) { edge->setControllingTLInformation(c, getID()); } } }
void NBLoadedTLDef::setTLControllingInformation(const NBEdgeCont& ec) const { // assign the links to the connections unsigned int pos = 0; for (SignalGroupCont::const_iterator m = mySignalGroups.begin(); m != mySignalGroups.end(); m++) { SignalGroup* group = (*m).second; unsigned int linkNo = group->getLinkNo(); for (unsigned int j = 0; j < linkNo; j++) { const NBConnection& conn = group->getConnection(j); assert(conn.getFromLane() < 0 || (int) conn.getFrom()->getNumLanes() > conn.getFromLane()); NBConnection tst(conn); tst.setTLIndex(pos); if (tst.check(ec)) { NBEdge* edge = conn.getFrom(); if (edge->setControllingTLInformation(tst, getID())) { pos++; } } else { WRITE_WARNING("Could not set signal on connection (signal: " + getID() + ", group: " + group->getID() + ")"); } } } }