// static std::string CModelParameter::nameFromCN(const CCopasiObjectName & cn) { CCopasiObjectName Primary = cn.getPrimary(); CCopasiObjectName Remainder = cn.getRemainder(); while (Remainder != "") { Primary = Remainder.getPrimary(); Remainder = Remainder.getRemainder(); } std::string Name = Primary.getElementName(0); if (Name != "") { return Name; } return Primary.getObjectName(); }
// virtual void CModelParameterSpecies::setCN(const CCopasiObjectName & cn) { CModelParameter::setCN(cn); // Determine the CN for the compartment. // "CN=Root,Model=New Model,Vector=Compartments[compartment],Vector=Metabolites[A]" CCopasiObjectName Tmp = mCN; std::string Separator = ""; for (; Tmp != ""; Tmp = Tmp.getRemainder()) { CCopasiObjectName Primary = Tmp.getPrimary(); mCompartmentCN += Separator + Primary; Separator = ","; if (Primary.getObjectType() == "Vector" && Primary.getObjectName() == "Compartments") { break; } } }