本文整理汇总了C++中NBTrafficLightLogicCont::removeFully方法的典型用法代码示例。如果您正苦于以下问题:C++ NBTrafficLightLogicCont::removeFully方法的具体用法?C++ NBTrafficLightLogicCont::removeFully怎么用?C++ NBTrafficLightLogicCont::removeFully使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBTrafficLightLogicCont
的用法示例。
在下文中一共展示了NBTrafficLightLogicCont::removeFully方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateNodeClusters
void
NBNodeCont::joinTLS(NBTrafficLightLogicCont& tlc, SUMOReal maxdist) {
std::vector<std::set<NBNode*> > cands;
generateNodeClusters(maxdist, cands);
unsigned int index = 0;
for (std::vector<std::set<NBNode*> >::iterator i = cands.begin(); i != cands.end(); ++i) {
std::set<NBNode*>& c = (*i);
for (std::set<NBNode*>::iterator j = c.begin(); j != c.end();) {
if (!(*j)->isTLControlled()) {
c.erase(j++);
} else {
++j;
}
}
if (c.size() < 2) {
continue;
}
// figure out type of the joined TLS
Position dummyPos;
bool dummySetTL;
std::string dummyId;
TrafficLightType type;
analyzeCluster(c, dummyId, dummyPos, dummySetTL, type);
for (std::set<NBNode*>::iterator j = c.begin(); j != c.end(); ++j) {
std::set<NBTrafficLightDefinition*> tls = (*j)->getControllingTLS();
(*j)->removeTrafficLights();
for (std::set<NBTrafficLightDefinition*>::iterator k = tls.begin(); k != tls.end(); ++k) {
tlc.removeFully((*j)->getID());
}
}
std::string id = "joinedS_" + toString(index++);
std::vector<NBNode*> nodes;
for (std::set<NBNode*>::iterator j = c.begin(); j != c.end(); j++) {
nodes.push_back(*j);
}
NBTrafficLightDefinition* tlDef = new NBOwnTLDef(id, nodes, 0, type);
if (!tlc.insert(tlDef)) {
// actually, nothing should fail here
WRITE_WARNING("Could not build a joined tls.");
delete tlDef;
return;
}
}
}