本文整理汇总了C++中Submodel::setId方法的典型用法代码示例。如果您正苦于以下问题:C++ Submodel::setId方法的具体用法?C++ Submodel::setId怎么用?C++ Submodel::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Submodel
的用法示例。
在下文中一共展示了Submodel::setId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
LIBSBML_CPP_NAMESPACE_USE
int main(int argc,char** argv)
{
DynPkgNamespaces sbmlns;
sbmlns.addPackageNamespace("comp", 1, "comp");
// create the document
SBMLDocument *document = new SBMLDocument(&sbmlns);
document->setPackageRequired("dyn", true);
document->setPackageRequired("comp", true);
// create the Model
Model* model=document->createModel();
model->setId("grid2x2");
// create the Compartment
Compartment* compartment = model->createCompartment();
compartment->setId("Loc1");
compartment->setConstant(false);
compartment->setSize(1);
compartment->setSpatialDimensions(2.0);
DynCompartmentPlugin* cplugin =
static_cast<DynCompartmentPlugin*>(compartment->getPlugin("dyn"));
SpatialComponent* component = cplugin->createSpatialComponent();
component->setSpatialIndex(DYN_SPATIALKIND_CARTESIANX);
component->setVariable("q1_X");
component = cplugin->createSpatialComponent();
component->setSpatialIndex(DYN_SPATIALKIND_CARTESIANY);
component->setVariable("q1_Y");
CompSBasePlugin* compPlugin =
static_cast<CompSBasePlugin*>(compartment->getPlugin("comp"));
ReplacedElement* relement = compPlugin->createReplacedElement();
relement->setIdRef("C");
relement->setSubmodelRef("GRID_1_1_cell");
compartment = model->createCompartment();
compartment->setId("Loc2");
compartment->setConstant(false);
compartment->setSize(1);
compartment->setSpatialDimensions(2.0);
cplugin =
static_cast<DynCompartmentPlugin*>(compartment->getPlugin("dyn"));
component = cplugin->createSpatialComponent();
component->setSpatialIndex(DYN_SPATIALKIND_CARTESIANX);
component->setVariable("q2_X");
component = cplugin->createSpatialComponent();
component->setSpatialIndex(DYN_SPATIALKIND_CARTESIANY);
component->setVariable("q2_Y");
compPlugin =
static_cast<CompSBasePlugin*>(compartment->getPlugin("comp"));
relement = compPlugin->createReplacedElement();
relement->setIdRef("C");
relement->setSubmodelRef("GRID_1_2_cell");
compartment = model->createCompartment();
compartment->setId("Loc3");
compartment->setConstant(false);
compartment->setSize(1);
compartment->setSpatialDimensions(2.0);
cplugin =
static_cast<DynCompartmentPlugin*>(compartment->getPlugin("dyn"));
component = cplugin->createSpatialComponent();
component->setSpatialIndex(DYN_SPATIALKIND_CARTESIANX);
component->setVariable("q3_X");
component = cplugin->createSpatialComponent();
component->setSpatialIndex(DYN_SPATIALKIND_CARTESIANY);
component->setVariable("q3_Y");
compPlugin =
static_cast<CompSBasePlugin*>(compartment->getPlugin("comp"));
relement = compPlugin->createReplacedElement();
relement->setIdRef("C");
relement->setSubmodelRef("GRID_2_1_cell");
compartment = model->createCompartment();
compartment->setId("Loc4");
compartment->setConstant(false);
compartment->setSize(1);
compartment->setSpatialDimensions(2.0);
cplugin =
//.........这里部分代码省略.........