本文整理汇总了C++中Eref::add方法的典型用法代码示例。如果您正苦于以下问题:C++ Eref::add方法的具体用法?C++ Eref::add怎么用?C++ Eref::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eref
的用法示例。
在下文中一共展示了Eref::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getRules
/*
* get Assignment Rule
*/
void SbmlReader::getRules()
{
unsigned int nr = model_->getNumRules();
//cout<<"no of rules:"<<nr<<endl;
for ( unsigned int r = 0;r < nr;r++ )
{
Rule * rule = model_->getRule(r);
//cout << "rule :" << rule->getFormula() << endl;
bool assignRule = rule->isAssignment();
//cout << "is assignment :" << assignRule << endl;
if ( assignRule ){
string rule_variable = rule->getVariable();
//cout << "variable :" << rule_variable << endl;
map< string,Eref >::iterator v_iter;
map< string,Eref >::iterator m_iter;
v_iter = elmtMap_.find( rule_variable );
if ( v_iter != elmtMap_.end() ){
Eref rVariable = elmtMap_.find(rule_variable)->second;
const ASTNode * ast = rule->getMath();
vector< string > ruleMembers;
ruleMembers.clear();
printMembers( ast,ruleMembers );
for ( unsigned int rm = 0; rm < ruleMembers.size(); rm++ )
{
m_iter = elmtMap_.find( ruleMembers[rm] );
if ( m_iter != elmtMap_.end() ){
Eref rMember = elmtMap_.find(ruleMembers[rm])->second;
rMember.add( "nSrc",rVariable,"sumTotal",ConnTainer::Default );
}
else{
cerr << "SbmlReader::getRules: Assignment rule member is not a species" << endl;
errorFlag_ = true;
}
}
}
else{
cerr << "SbmlReader::getRules: for now Assignment rule for parameter/compartment is not handled" << endl;
errorFlag_ = true;
}
}
bool rateRule = rule->isRate();
if ( rateRule ){
cout << "warning : for now Rate Rule is not handled " << endl;
errorFlag_ = true;
}
bool algebRule = rule->isAlgebraic();
if ( algebRule ){
cout << "warning: for now Algebraic Rule is not handled" << endl;
errorFlag_ = true;
}
}
}
示例2: zombify
/**
* This operation turns the target element e into a zombie controlled
* by the hub/solver. It gets rid of any process message coming into
* the zombie and replaces it with one from the solver.
*/
void HSolveHub::zombify(
Eref hub, Eref e,
const Finfo* hubFinfo, Finfo* solveFinfo )
{
// Replace the original procFinfo with one from the hub.
const Finfo* procFinfo = e->findFinfo( "process" );
e.dropAll( procFinfo->msg() );
bool ret = hub.add( hubFinfo->msg(), e, procFinfo->msg(),
ConnTainer::Default );
assert( ret );
// Redirect original messages from the zombie to the hub.
// Pending.
// Replace the 'ThisFinfo' on the solved element
e->setThisFinfo( solveFinfo );
}