当前位置: 首页>>代码示例>>C++>>正文


C++ ConstraintSet类代码示例

本文整理汇总了C++中ConstraintSet的典型用法代码示例。如果您正苦于以下问题:C++ ConstraintSet类的具体用法?C++ ConstraintSet怎么用?C++ ConstraintSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ConstraintSet类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

/*
 * Adds the given Contraint to the appropriate ConstraintSet.
 */
void
ReqValidatorConstraints::add (VConstraint* c)
{
  if (c == NULL) return;

  ptrMap.insert(pair<VConstraint*,bool>(c,true));

  if (dynamic_cast< TConstraint<SBMLDocument>* >(c) != NULL)
  {
    mSBMLDocument.add( static_cast< TConstraint<SBMLDocument>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Model>* >(c) != NULL)
  {
    mModel.add( static_cast< TConstraint<Model>* >(c) );
    return;
  }
  if (dynamic_cast< TConstraint<ChangedMath>* >(c) != NULL)
  {
    mChangedMath.add( static_cast< TConstraint<ChangedMath>* >(c) );
    return;
  }

}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:28,代码来源:ReqValidator.cpp

示例2: getIndependentCoordinate

string MuscleOptimizer::getIndependentCoordinate(Model& model, const std::string& dofName)
{
    ConstraintSet constraintSet = model.getConstraintSet();
    for (int n = 0; n < constraintSet.getSize(); ++n)
    {
        CoordinateCouplerConstraint* constraint = dynamic_cast<CoordinateCouplerConstraint*>(&constraintSet.get(n));
        if (constraint != NULL) // we can only handle this type of constraint, so we just skip the others
        {
            string depCoordinateName = constraint->getDependentCoordinateName();
            if (depCoordinateName == dofName)
            {
                const Array<std::string>& indepCoordinateNamesSet = constraint->getIndependentCoordinateNames();
                if (indepCoordinateNamesSet.getSize() == 1)
                {
                    return indepCoordinateNamesSet.get(0);
                }
                else if (indepCoordinateNamesSet.getSize() > 1)
                {
                    std::cout << "CoordinateCouplerConstraint with dependent coordinate " << dofName << " has more than one indipendent coordinate and this is not managed by this software yet." << std::endl;
                    return "";
                }
            }

        }

    }
    return "";
}
开发者ID:MuscleOptimizer,项目名称:MuscleOptimizer,代码行数:28,代码来源:MuscleOptimizer.cpp

示例3:

/*
 * Adds the given Contraint to the appropriate ConstraintSet.
 */
void
ArraysValidatorConstraints::add (VConstraint* c)
{
  if (c == NULL) return;

  ptrMap.insert(pair<VConstraint*,bool>(c,true));

  if (dynamic_cast< TConstraint<SBMLDocument>* >(c) != NULL)
  {
    mSBMLDocument.add( static_cast< TConstraint<SBMLDocument>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Model>* >(c) != NULL)
  {
    mModel.add( static_cast< TConstraint<Model>* >(c) );
    return;
  }
  if (dynamic_cast< TConstraint<Dimension>* >(c) != NULL)
  {
    mDimension.add( static_cast< TConstraint<Dimension>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Index>* >(c) != NULL)
  {
    mIndex.add( static_cast< TConstraint<Index>* >(c) );
    return;
  }

}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:34,代码来源:ArraysValidator.cpp

示例4: CreateDesertConstraintSet

bool CreateDesertConstraintSet(ConstraintSet &cs, UdmDesertMap &des_map, DesertUdmMap &inv_des_map )
{
	bool ret = true;
	Constraint ct;
	Element owner;
	long cts_id;
	set<Constraint> ct_set = cs.Constraint_children();
	set<Constraint>::iterator ct_iterator;

	ASSERT(!ct_set.empty());
	//create constraint set
	cts_id = CreateConstraintSet(utf82cstring((string)cs.name()));
	DoMap(cs, des_map, inv_des_map, cts_id);


	for(ct_iterator = ct_set.begin(); ct_iterator != ct_set.end(); ct_iterator++)
	{
		//get owner element
		ct = *(ct_iterator);
		owner = ct.context();
		std::string aa = owner.name();
		
		//lookup in the map 
		long owner_id = GetID(owner, des_map);

		//create constraint
		
		long ct_id = CreateConstraint(utf82cstring((string)ct.name()),
						cts_id, 
						owner_id, 
						utf82cstring((string)ct.expression()));
		/*
		long ct_id = CreateConstraint(((string)ct.name()).c_str(), 
						cts_id, 
						owner_id, 
						((string)ct.expression()).c_str(),
						ct.id(),
						ct.externalID());
		*/
		if(ct_id==-1) ret = false;
		DoMap(ct, des_map, inv_des_map,  ct_id);

	}//eo for (ct_iterator)
	return ret;
};//eo bool CreateDesertConstrainSet
开发者ID:neemask,项目名称:meta-core,代码行数:45,代码来源:DesMap.cpp

示例5: CreateConstraints

bool CreateConstraints(DesertSystem &ds, UdmDesertMap &des_map, DesertUdmMap &inv_des_map)
{

	//constrainsets, constrainst
	set<ConstraintSet> c_sets = ds.ConstraintSet_kind_children();
	set<ConstraintSet>::iterator cts_iterator;


	if (!c_sets.empty())
	{
		ConstraintSet cs;
		for (cts_iterator = c_sets.begin(); cts_iterator != c_sets.end(); cts_iterator++)
		{
			cs = *(cts_iterator);
			set<Constraint> ct_set = cs.Constraint_kind_children();

			if (ct_set.empty()) continue;
			CreateDesertConstraintSet(cs, des_map, inv_des_map);

		}//eo for cts_iterator
	}//eo if (!c_sets.empty())
	return true;
};
开发者ID:pombredanne,项目名称:metamorphosys-desktop,代码行数:23,代码来源:DesMap.cpp

示例6:

/*
 * Adds the given Contraint to the appropriate ConstraintSet.
 */
void
GroupsValidatorConstraints::add (VConstraint* c)
{
  if (c == NULL) return;

  ptrMap.insert(pair<VConstraint*,bool>(c,true));

  if (dynamic_cast< TConstraint<SBMLDocument>* >(c) != NULL)
  {
    mSBMLDocument.add( static_cast< TConstraint<SBMLDocument>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Model>* >(c) != NULL)
  {
    mModel.add( static_cast< TConstraint<Model>* >(c) );
    return;
  }
  if (dynamic_cast< TConstraint<Member>* >(c) != NULL)
  {
    mMember.add( static_cast< TConstraint<Member>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<MemberConstraint>* >(c) != NULL)
  {
    mMemberConstraint.add( static_cast< TConstraint<MemberConstraint>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Group>* >(c) != NULL)
  {
    mGroup.add( static_cast< TConstraint<Group>* >(c) );
    return;
  }

}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:40,代码来源:GroupsValidator.cpp

示例7:

/*
 * Adds the given Contraint to the appropriate ConstraintSet.
 */
void
DistribValidatorConstraints::add (VConstraint* c)
{
  if (c == NULL) return;

  ptrMap.insert(pair<VConstraint*,bool>(c,true));

  if (dynamic_cast< TConstraint<SBMLDocument>* >(c) != NULL)
  {
    mSBMLDocument.add( static_cast< TConstraint<SBMLDocument>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Model>* >(c) != NULL)
  {
    mModel.add( static_cast< TConstraint<Model>* >(c) );
    return;
  }
  if (dynamic_cast< TConstraint<DrawFromDistribution>* >(c) != NULL)
  {
    mDrawFromDistribution.add( static_cast< TConstraint<DrawFromDistribution>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<DistribInput>* >(c) != NULL)
  {
    mDistribInput.add( static_cast< TConstraint<DistribInput>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Uncertainty>* >(c) != NULL)
  {
    mUncertainty.add( static_cast< TConstraint<Uncertainty>* >(c) );
    return;
  }

}
开发者ID:TheCoSMoCompany,项目名称:biopredyn,代码行数:40,代码来源:DistribValidator.cpp

示例8:

/*
 * Adds the given Contraint to the appropriate ConstraintSet.
 */
void
QualValidatorConstraints::add (VConstraint* c)
{
  if (c == NULL) return;

  ptrMap.insert(pair<VConstraint*,bool>(c,true));

  if (dynamic_cast< TConstraint<SBMLDocument>* >(c) != NULL)
  {
    mSBMLDocument.add( static_cast< TConstraint<SBMLDocument>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Model>* >(c) != NULL)
  {
    mModel.add( static_cast< TConstraint<Model>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<QualitativeSpecies>* >(c) != NULL)
  {
    mQualitativeSpecies.add( static_cast< TConstraint<QualitativeSpecies>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Transition>* >(c) != NULL)
  {
    mTransition.add( static_cast< TConstraint<Transition>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Input>* >(c) != NULL)
  {
    mInput.add( static_cast< TConstraint<Input>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Output>* >(c) != NULL)
  {
    mOutput.add( static_cast< TConstraint<Output>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<FunctionTerm>* >(c) != NULL)
  {
    mFunctionTerm.add( static_cast< TConstraint<FunctionTerm>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<DefaultTerm>* >(c) != NULL)
  {
    mDefaultTerm.add( static_cast< TConstraint<DefaultTerm>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<ListOfFunctionTerms>* >(c) != NULL)
  {
    mListOfFunctionTerms.add( static_cast< TConstraint<ListOfFunctionTerms>* >(c) );
    return;
  }
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:64,代码来源:QualValidator.cpp

示例9:

/*
 * Adds the given Contraint to the appropriate ConstraintSet.
 */
void
ValidatorConstraints::add (VConstraint* c)
{
  ptrMap.insert(pair<VConstraint*,bool>(c,true));

  if (dynamic_cast< TConstraint<SBMLDocument>* >(c))
  {
    mSBMLDocument.add( static_cast< TConstraint<SBMLDocument>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Model>* >(c))
  {
    mModel.add( static_cast< TConstraint<Model>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<FunctionDefinition>* >(c))
  {
    mFunctionDefinition.add
    (
      static_cast< TConstraint<FunctionDefinition>* >(c)
    );
    return;
  }

  if (dynamic_cast< TConstraint<UnitDefinition>* >(c))
  {
    mUnitDefinition.add( static_cast< TConstraint<UnitDefinition>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Unit>* >(c))
  {
    mUnit.add( static_cast< TConstraint<Unit>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Compartment>* >(c))
  {
    mCompartment.add( static_cast< TConstraint<Compartment>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Species>* >(c))
  {
    mSpecies.add( static_cast< TConstraint<Species>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Parameter>* >(c))
  {
    mParameter.add( static_cast< TConstraint<Parameter>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Rule>* >(c))
  {
    mRule.add( static_cast< TConstraint<Rule>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<AlgebraicRule>* >(c))
  {
    mAlgebraicRule.add( static_cast< TConstraint<AlgebraicRule>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<AssignmentRule>* >(c))
  {
    mAssignmentRule.add( static_cast< TConstraint<AssignmentRule>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<RateRule>* >(c))
  {
    mRateRule.add( static_cast< TConstraint<RateRule>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Reaction>* >(c))
  {
    mReaction.add( static_cast< TConstraint<Reaction>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<KineticLaw>* >(c))
  {
    mKineticLaw.add( static_cast< TConstraint<KineticLaw>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<SimpleSpeciesReference>* >(c))
  {
    mSimpleSpeciesReference.add
    (
      static_cast< TConstraint<SimpleSpeciesReference>* >(c)
//.........这里部分代码省略.........
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:101,代码来源:Validator.cpp

示例10: xBestIndex

static int xBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo) {
  auto *pVtab = (VirtualTable *)tab;
  ConstraintSet constraints;
  // Keep track of the index used for each valid constraint.
  // Expect this index to correspond with argv within xFilter.
  size_t expr_index = 0;
  // If any constraints are unusable increment the cost of the index.
  double cost = 1;
  // Expressions operating on the same virtual table are loosely identified by
  // the consecutive sets of terms each of the constraint sets are applied onto.
  // Subsequent attempts from failed (unusable) constraints replace the set,
  // while new sets of terms append.
  if (pIdxInfo->nConstraint > 0) {
    for (size_t i = 0; i < static_cast<size_t>(pIdxInfo->nConstraint); ++i) {
      // Record the term index (this index exists across all expressions).
      const auto &constraint_info = pIdxInfo->aConstraint[i];
#if defined(DEBUG)
      plan("Evaluating constraints for table: " + pVtab->content->name +
           " [index=" + std::to_string(i) + " column=" +
           std::to_string(constraint_info.iColumn) + " term=" +
           std::to_string((int)constraint_info.iTermOffset) + " usable=" +
           std::to_string((int)constraint_info.usable) + "]");
#endif
      if (!constraint_info.usable) {
        // A higher cost less priority, prefer more usable query constraints.
        cost += 10;
        continue;
      }

      // Lookup the column name given an index into the table column set.
      if (constraint_info.iColumn < 0 ||
          static_cast<size_t>(constraint_info.iColumn) >=
              pVtab->content->columns.size()) {
        cost += 10;
        continue;
      }
      const auto &name = pVtab->content->columns[constraint_info.iColumn].first;
      // Save a pair of the name and the constraint operator.
      // Use this constraint during xFilter by performing a scan and column
      // name lookup through out all cursor constraint lists.
      constraints.push_back(
          std::make_pair(name, Constraint(constraint_info.op)));
      pIdxInfo->aConstraintUsage[i].argvIndex = ++expr_index;
#if defined(DEBUG)
      plan("Adding constraint for table: " + pVtab->content->name +
           " [column=" + name + " arg_index=" + std::to_string(expr_index) +
           "]");
#endif
    }
  }

  pIdxInfo->idxNum = kConstraintIndexID++;
// Add the constraint set to the table's tracked constraints.
#if defined(DEBUG)
  plan("Recording constraint set for table: " + pVtab->content->name +
       " [cost=" + std::to_string(cost) + " size=" +
       std::to_string(constraints.size()) + " idx=" +
       std::to_string(pIdxInfo->idxNum) + "]");
#endif
  pVtab->content->constraints[pIdxInfo->idxNum] = std::move(constraints);
  pIdxInfo->estimatedCost = cost;
  return SQLITE_OK;
}
开发者ID:200GAUTAM,项目名称:osquery,代码行数:63,代码来源:virtual_table.cpp

示例11: abort

bool LeoModel::loadConstraintSetsFromFile (const char* filename, bool verbose) {
	// initialize Constraint Sets
	LuaTable lua_table = LuaTable::fromFile (filename);

	vector<LuaKey> constraint_set_keys = lua_table["constraint_sets"].keys();
	vector<string> constraint_set_names;
	for (size_t i = 0; i < constraint_set_keys.size(); i++) {
		if (constraint_set_keys[i].type == LuaKey::String) {
			constraint_set_names.push_back (constraint_set_keys[i].string_value);
		}
		else {
			cerr << "Found invalid constraint set name, string expected!" <<  endl;
			abort();
		}
	}

	for (size_t si = 0; si < constraint_set_names.size(); si++) {
		string set_name_str = constraint_set_names[si];

		if (verbose) {
			cout << "ConstraintSet '" << set_name_str << endl;
		}

		unsigned int constraint_count =
			lua_table["constraint_sets"][constraint_set_names[si].c_str()].length();

		ConstraintSet cs;
		ConstraintSetInfo csi;
		csi.name = set_name_str;
		csi.constraints.resize (constraint_count);

		for (int ci = 0; ci < constraint_count; ci++) {
			ConstraintInfo constraint_info =
			lua_table["constraint_sets"][set_name_str.c_str()][ci + 1];
			string point_name = constraint_info.point_name.c_str();
			constraint_info.point_id = ci;

			if (verbose) {
				cout << "  Adding Constraint point: " << points[point_name].name << endl;
				cout << "    body id = " << points[point_name].body_id << endl;
				cout << "    normal =  [" << constraint_info.normal.transpose() << "]" << endl;
			}
			cs.AddConstraint (
				points[point_name].body_id,
				points[point_name].point_local,
				constraint_info.normal
			);
			csi.constraints[ci] = constraint_info;
		}

		// save constraint set infos
		constraintSetInfos[set_name_str] = csi;

		// assign constraint set
		constraints[set_name_str] = cs;
		// TODO check which solver works better
		constraints[set_name_str].linear_solver = LinearSolverHouseholderQR;
		// constraintSets[set_name].linear_solver = LinearSolverPartialPivLU;
		constraints[set_name_str].Bind (model);
	}

	// check whether we missed some sets
	if (constraints.size() != constraint_set_names.size()) {
		cerr << "Error: not all constraint sets have been loaded!" << endl;
		abort();
	}

	return true;
}
开发者ID:ikoryakovskiy,项目名称:grl,代码行数:69,代码来源:leomodel.cpp

示例12: checkTypes

void checkTypes() {
  VariableIdMapping variableIdMapping;
  PState s1;
  cout << "RUNNING CHECKS:"<<endl;
  {
    // check temporary variables (create and delete)
    VariableId var_tmp=variableIdMapping.createUniqueTemporaryVariableId("tmp");
    variableIdMapping.deleteUniqueTemporaryVariableId(var_tmp);
  }

  {
    cout << "------------------------------------------"<<endl;
    cout << "RUNNING CHECKS FOR BOOLLATTICE TYPE:"<<endl;
    AType::BoolLattice a;
    a=true;
    check("a=true => isTrue",a.isTrue());
    AType::BoolLattice b;
    b=false;
    check("b=false => isFalse",b.isFalse());
    AType::BoolLattice c=a||b;
    check("c=a||b => c isTrue ",c.isTrue());
    AType::Top e;
    AType::BoolLattice d;
    d=e;
    check("Top e; d=e => d isTop",d.isTop());
    c=c||d;
    check("c=c||d: true",c.isTrue());
    AType::BoolLattice f=AType::Bot();
    d=AType::Bot();
    check("d=bot: bot",d.isBot());
    check("f=bot: bot",f.isBot());
    a=d&&f;
    check("a=d&&f => a isBot",a.isBot());
    f=false;
    check("f=false => f isFalse",f.isFalse());
    a=d&&f;
    check("a=d&&f: a isFalse (we define it this way)",a.isFalse());
  }

  {
    cout << "RUNNING CHECKS FOR CONSTINT LATTICE TYPE:"<<endl;
    AType::ConstIntLattice a;
    a=true;
    check("a=true => isTrue",a.isTrue());
    check("a=true => !isFalse",!a.isFalse());
    AType::ConstIntLattice b;
    b=false;
    check("b=false => isFalse",b.isFalse());
    check("b=false => !isTrue",!b.isTrue());
    AType::ConstIntLattice c=a.operatorOr(b);
    check("c=a.operatorOr(b): ",c.isTrue());
    AType::Top e;
    AType::ConstIntLattice d;
    d=e;
    check("Top e; d=e; d isTop ",d.isTop());
    c=c.operatorOr(d);
    check("c=c.operatorOr(d) => c isTrue ",c.isTrue());
    AType::ConstIntLattice f=AType::Bot();
    d=AType::Bot();
    
    a=d.operatorAnd(f);
    check("d=bot;f=bot;a=d.operatorAnd(f); => a isBot",a.isBot());
    f=false;
    a=d.operatorAnd(f);
    check("f=false; a=d.operatorAnd(f); => a isFalse",a.isFalse());
    a=5;
    check("a=5; a.isTrue()==true",a.isTrue()==true);
    check("a=5; a.isFalse()==false",a.isFalse()==false);

    a=0;
    check("a=0; a.isTrue()==false",a.isTrue()==false);
    check("a=0; a.isFalse())==true",a.isFalse()==true);
  }

  {
    cout << "------------------------------------------"<<endl;
    cout << "RUNNING CHECKS FOR CONSTRAINT TYPE:"<<endl;
    VariableId var_x=variableIdMapping.createUniqueTemporaryVariableId("x");
    VariableId var_y=variableIdMapping.createUniqueTemporaryVariableId("y");
    cout << "P1"<<endl;
    Constraint c1(Constraint::EQ_VAR_CONST,var_x,1);
    cout << "P2"<<endl;
    Constraint c2(Constraint::NEQ_VAR_CONST,var_y,2);
    cout << "P3"<<endl;
    Constraint c3=DISEQUALITYCONSTRAINT;
    cout << "P4"<<endl;
    Constraint c4=Constraint(Constraint::EQ_VAR_CONST,var_y,2);
    cout << "P5"<<endl;
    ConstraintSet cs;
    cout << "P6"<<endl;
    cs.addConstraint(c1);
    cout << "P7"<<endl;
    cout << "CS1:"<<cs.toString()<<endl;
    cs.addConstraint(c2);
    cout << "CS2:"<<cs.toString()<<endl;
    check("inserted 2 different constraints, size of constraint set == 3",cs.size()==2);
    check("c1:constraintExists(EQ_VAR_CONST,x,1) == true",cs.constraintExists(Constraint::EQ_VAR_CONST,var_x,1));
    check("c1:constraintExists(NEQ_VAR_CONST,x,1) == false",!cs.constraintExists(Constraint::NEQ_VAR_CONST,var_x,1));
    check("c2:constraintExists(NEQ_VAR_CONST,y,2) == true",cs.constraintExists(Constraint::NEQ_VAR_CONST,var_y,2));
    check("c3:isDisequality==false",cs.disequalityExists()==false);
//.........这里部分代码省略.........
开发者ID:8l,项目名称:rose,代码行数:101,代码来源:InternalChecks.C

示例13:

/*
 * Adds the given Contraint to the appropriate ConstraintSet.
 */
void
MultiValidatorConstraints::add (VConstraint* c)
{
  if (c == NULL) return;

  ptrMap.insert(pair<VConstraint*,bool>(c,true));

  if (dynamic_cast< TConstraint<SBMLDocument>* >(c) != NULL)
  {
    mSBMLDocument.add( static_cast< TConstraint<SBMLDocument>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<Model>* >(c) != NULL)
  {
    mModel.add( static_cast< TConstraint<Model>* >(c) );
    return;
  }
  if (dynamic_cast< TConstraint<PossibleSpeciesFeatureValue>* >(c) != NULL)
  {
    mPossibleSpeciesFeatureValue.add( static_cast< TConstraint<PossibleSpeciesFeatureValue>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<SpeciesFeatureValue>* >(c) != NULL)
  {
    mSpeciesFeatureValue.add( static_cast< TConstraint<SpeciesFeatureValue>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<CompartmentReference>* >(c) != NULL)
  {
    mCompartmentReference.add( static_cast< TConstraint<CompartmentReference>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<SpeciesTypeInstance>* >(c) != NULL)
  {
    mSpeciesTypeInstance.add( static_cast< TConstraint<SpeciesTypeInstance>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<InSpeciesTypeBond>* >(c) != NULL)
  {
    mInSpeciesTypeBond.add( static_cast< TConstraint<InSpeciesTypeBond>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<DenotedSpeciesTypeComponentIndex>* >(c) != NULL)
  {
    mDenotedSpeciesTypeComponentIndex.add( static_cast< TConstraint<DenotedSpeciesTypeComponentIndex>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<OutwardBindingSite>* >(c) != NULL)
  {
    mOutwardBindingSite.add( static_cast< TConstraint<OutwardBindingSite>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<SpeciesFeatureChange>* >(c) != NULL)
  {
    mSpeciesFeatureChange.add( static_cast< TConstraint<SpeciesFeatureChange>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<SpeciesFeatureType>* >(c) != NULL)
  {
    mSpeciesFeatureType.add( static_cast< TConstraint<SpeciesFeatureType>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<SpeciesTypeComponentIndex>* >(c) != NULL)
  {
    mSpeciesTypeComponentIndex.add( static_cast< TConstraint<SpeciesTypeComponentIndex>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<SpeciesFeature>* >(c) != NULL)
  {
    mSpeciesFeature.add( static_cast< TConstraint<SpeciesFeature>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<SpeciesTypeComponentMapInProduct>* >(c) != NULL)
  {
    mSpeciesTypeComponentMapInProduct.add( static_cast< TConstraint<SpeciesTypeComponentMapInProduct>* >(c) );
    return;
  }

  if (dynamic_cast< TConstraint<MultiSpeciesType>* >(c) != NULL)
  {
    mMultiSpeciesType.add( static_cast< TConstraint<MultiSpeciesType>* >(c) );
    return;
  }

}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:100,代码来源:MultiValidator.cpp


注:本文中的ConstraintSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。