本文整理汇总了C++中NBEdge::setControllingTLInformation方法的典型用法代码示例。如果您正苦于以下问题:C++ NBEdge::setControllingTLInformation方法的具体用法?C++ NBEdge::setControllingTLInformation怎么用?C++ NBEdge::setControllingTLInformation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBEdge
的用法示例。
在下文中一共展示了NBEdge::setControllingTLInformation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getID
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());
}
}
示例2: throw
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++;
}
}
}
示例3: assert
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());
}
}
示例4: ProcessError
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());
}
}
}
示例5: tst
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() + ")");
}
}
}
}