本文整理汇总了C++中SpeciesReference::isSetStoichiometry方法的典型用法代码示例。如果您正苦于以下问题:C++ SpeciesReference::isSetStoichiometry方法的具体用法?C++ SpeciesReference::isSetStoichiometry怎么用?C++ SpeciesReference::isSetStoichiometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpeciesReference
的用法示例。
在下文中一共展示了SpeciesReference::isSetStoichiometry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkSpeciesRefs
void checkSpeciesRefs(Model* model, ListOfSpeciesReferences* losr, set<string>& components, set<string>& tests, const map<string, vector<double> >& results)
{
for (unsigned int rp=0; rp<losr->size(); rp++) {
SpeciesReference* sr = static_cast<SpeciesReference*>(losr->get(rp));
if (sr->isSetStoichiometry() && sr->getStoichiometry() != 1) {
tests.insert("NonUnityStoichiometry");
}
if (sr->isSetStoichiometryMath()) {
tests.insert("NonUnityStoichiometry");
components.insert("StoichiometryMath");
if (variesIn(sr->getStoichiometryMath()->getMath(), model, results)) {
tests.insert("AssignedVariableStoichiometry");
}
else {
tests.insert("AssignedConstantStoichiometry");
}
}
else if (sr->isSetId()) {
double initialResult = 1;
if (results.find(sr->getId()) != results.end()) {
tests.insert("SpeciesReferenceOutput");
}
if (variesIn(sr->getId(), model, results)) {
tests.insert("AssignedVariableStoichiometry");
tests.insert("NonUnityStoichiometry");
}
else if (initialOverriddenIn(sr->getId(), model, results, tests)) {
tests.insert("AssignedConstantStoichiometry");
if (getInitialResultFor(sr->getId(), results, initialResult)) {
if (initialResult != 1) {
tests.insert("NonUnityStoichiometry");
}
}
else {
//Don't know what the actual initial result is, so we'll assume it's not 1.0.
tests.insert("NonUnityStoichiometry");
}
}
if (initialOverriddenIn(sr->getId(), model, results, tests)) {
tests.insert("InitialValueReassigned");
}
if (foundInMath(sr->getId(), model)) {
tests.insert("SpeciesReferenceInMath");
}
}
}
}
示例2: if
void
Model::dealWithStoichiometry()
{
unsigned int idCount = 0;
for (unsigned int i = 0; i < getNumReactions(); i++)
{
Reaction *r = getReaction(i);
unsigned int j;
for (j = 0; j < r->getNumReactants(); j++)
{
SpeciesReference *sr = r->getReactant(j);
if (sr->isSetStoichiometry() == false)
{
if (sr->isSetId() == false)
{
createNoValueStoichMath(*this, *sr, idCount);
idCount++;
}
else
{
// id is set it could be used by initialAssignment
// used by rule
// not used
if (getInitialAssignment(sr->getId()) != NULL)
{
useStoichMath(*this, *sr, false);
}
else if (getRule(sr->getId()) != NULL)
{
//assignmentRule
if (getRule(sr->getId())->getTypeCode() == SBML_ASSIGNMENT_RULE)
{
useStoichMath(*this, *sr, true);
}
else if (getRule(sr->getId())->getTypeCode() == SBML_RATE_RULE)
{
createParameterAsRateRule(*this, *sr, *(getRule(sr->getId())), idCount);
idCount++;
}
}
else
{
createNoValueStoichMath(*this, *sr, idCount);
idCount++;
}
}
}
else
{
// stoichiometry is set
if (sr->isSetId())
{
// id is set it could be used by initialAssignment
// used by rule
// not used
if (getInitialAssignment(sr->getId()) != NULL)
{
useStoichMath(*this, *sr, false);
}
else if (getRule(sr->getId()) != NULL)
{
//assignmentRule
if (getRule(sr->getId())->getTypeCode() == SBML_ASSIGNMENT_RULE)
{
useStoichMath(*this, *sr, true);
}
else if (getRule(sr->getId())->getTypeCode() == SBML_RATE_RULE)
{
createParameterAsRateRule(*this, *sr, *(getRule(sr->getId())), idCount);
idCount++;
}
}
}
// no id set - do not need to do anything
}
}
for (j = 0; j < r->getNumProducts(); j++)
{
SpeciesReference *sr = r->getProduct(j);
if (sr->isSetStoichiometry() == false)
{
if (sr->isSetId() == false)
{
createNoValueStoichMath(*this, *sr, idCount);
idCount++;
}
else
{
// id is set it could be used by initialAssignment
// used by rule
// not used
if (getInitialAssignment(sr->getId()) != NULL)
{
useStoichMath(*this, *sr, false);
}
else if (getRule(sr->getId()) != NULL)
{
//assignmentRule
if (getRule(sr->getId())->getTypeCode() == SBML_ASSIGNMENT_RULE)
//.........这里部分代码省略.........