本文整理汇总了C++中DagNode::isClamped方法的典型用法代码示例。如果您正苦于以下问题:C++ DagNode::isClamped方法的具体用法?C++ DagNode::isClamped怎么用?C++ DagNode::isClamped使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DagNode
的用法示例。
在下文中一共展示了DagNode::isClamped方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resetDagNodes
/**
* Reset the currently monitored DAG nodes by extracting the DAG nodes from the model again
* and store this in the set of DAG nodes.
*/
void ModelMonitor::resetDagNodes( void )
{
// for savety we empty our dag nodes
nodes.clear();
if ( model != NULL )
{
// we only want to have each nodes once
// this should by default happen by here we check again
std::set<std::string> varNames;
const std::vector<DagNode*> &n = model->getDagNodes();
for (std::vector<DagNode*>::const_iterator it = n.begin(); it != n.end(); ++it)
{
DagNode *theNode = *it;
// only simple numeric variable can be monitored (i.e. only integer and real numbers)
if ( theNode->isSimpleNumeric() && !theNode->isClamped())
{
if ( (!stochasticNodesOnly && !theNode->isConstant() && theNode->getName() != "" && !theNode->isHidden() && !theNode->isElementVariable() ) || ( theNode->isStochastic() && !theNode->isClamped() && theNode->isHidden() == false && theNode->isElementVariable() == false ) )
{
const std::string &name = theNode->getName();
if ( varNames.find( name ) == varNames.end() )
{
nodes.push_back( theNode );
varNames.insert( name );
}
else
{
/*
std::cerr << "Trying to add variable with name '" << name << "' twice." << std::endl;
*/
}
}
}
}
}
}