本文整理汇总了C++中NBNode::getOppositeIncoming方法的典型用法代码示例。如果您正苦于以下问题:C++ NBNode::getOppositeIncoming方法的具体用法?C++ NBNode::getOppositeIncoming怎么用?C++ NBNode::getOppositeIncoming使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBNode
的用法示例。
在下文中一共展示了NBNode::getOppositeIncoming方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// ---------------------------------------------------------------------------
// NBNodeTypeComputer
// ---------------------------------------------------------------------------
void
NBNodeTypeComputer::computeNodeTypes(NBNodeCont& nc) {
for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
NBNode* n = (*i).second;
// the type may already be set from the data
if (n->myType != NODETYPE_UNKNOWN) {
continue;
}
// check whether the junction is not a real junction
if (n->myIncomingEdges.size() == 1) {
n->myType = NODETYPE_PRIORITY;
continue;
}
// @todo "isSimpleContinuation" should be revalidated
if (n->isSimpleContinuation()) {
n->myType = NODETYPE_PRIORITY;
continue;
}
// determine the type
SumoXMLNodeType type = NODETYPE_RIGHT_BEFORE_LEFT;
for (EdgeVector::const_iterator i = n->myIncomingEdges.begin(); i != n->myIncomingEdges.end(); i++) {
for (EdgeVector::const_iterator j = i + 1; j != n->myIncomingEdges.end(); j++) {
// @todo "getOppositeIncoming" should probably be refactored into something the edge knows
if (n->getOppositeIncoming(*j) == *i && n->myIncomingEdges.size() > 2) {
continue;
}
// @todo check against a legal document
// @todo figure out when NODETYPE_PRIORITY_STOP is appropriate
const SUMOReal s1 = (*i)->getSpeed() * (SUMOReal) 3.6;
const SUMOReal s2 = (*j)->getSpeed() * (SUMOReal) 3.6;
const int p1 = (*i)->getPriority();
const int p2 = (*j)->getPriority();
if (fabs(s1 - s2) > (SUMOReal) 9.5 || MAX2(s1, s2) >= (SUMOReal) 49. || p1 != p2) {
type = NODETYPE_PRIORITY;
break;
}
}
}
// save type
n->myType = type;
}
}