COPASI API  4.16.103
CModelParameter.cpp
Go to the documentation of this file.
1 // Copyright (C) 2011 - 2014 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 #include <limits>
7 
8 #include "copasi.h"
9 
10 #include "CModelParameter.h"
11 #include "CModelParameterGroup.h"
12 #include "CModelParameterSet.h"
13 #include "CMetabNameInterface.h"
14 #include "CReaction.h"
16 #include "function/CExpression.h"
17 #include "model/CModel.h"
19 #include "report/CKeyFactory.h"
20 #include "report/CCopasiObject.h"
21 #include "utilities/CDimension.h"
22 
23 // static
24 const char * CModelParameter::TypeNames[] =
25 {
26  "Model",
27  "Compartment",
28  "Species",
29  "ModelValue",
30  "ReactionParameter",
31  "Reaction",
32  "Group",
33  "Set",
34  "unknown",
35  NULL
36 };
37 
38 // static
40 {
41  CCopasiObjectName Primary = cn.getPrimary();
42  CCopasiObjectName Remainder = cn.getRemainder();
43 
44  while (Remainder != "")
45  {
46  Primary = Remainder.getPrimary();
47  Remainder = Remainder.getRemainder();
48  }
49 
50  std::string Name = Primary.getElementName(0);
51 
52  if (Name != "")
53  {
54  return Name;
55  }
56 
57  return Primary.getObjectName();
58 }
59 
61  mpParent(static_cast< CModelParameterGroup * >(pParent)),
62  mType(type),
63  mCN(),
64  mSimulationType(type == CModelParameter::Model ? CModelEntity::TIME : CModelEntity::FIXED),
65  mValue(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
66  mpInitialExpression(NULL),
67  mCompareResult(CModelParameter::Identical),
68  mpObject(NULL),
69  mIsInitialExpressionValid(true)
70 {
71  assert(mType == Set || mpParent != NULL);
72 }
73 
75  mpParent(pParent),
76  mType(src.mType),
77  mCN(src.mCN),
78  mSimulationType(src.mSimulationType),
79  mValue(src.mValue),
80  mpInitialExpression(NULL),
81  mCompareResult(src.mCompareResult),
82  mpObject(src.mpObject),
83  mIsInitialExpressionValid(src.mIsInitialExpressionValid)
84 {
85  assert(mType == Set || mpParent != NULL);
86 
88 }
89 
90 // virtual
92 {
93  if (mpParent != NULL)
94  {
95  mpParent->remove(this);
96  }
97 }
98 
100 {
101  mpParent = pParent;
102 }
103 
105 {
106  return mpParent;
107 }
108 
110 {
111  return mType;
112 }
113 
114 const std::string CModelParameter::getUnit(const Framework & framework) const
115 {
116  std::string Unit;
117 
118  switch (mType)
119  {
120  case Model:
122  break;
123 
124  case Compartment:
125  {
126  const CCompartment * pCompartment = static_cast< const CCompartment * >(mpObject);
127 
128  if (pCompartment == NULL)
129  {
130  return "";
131  }
132 
133  return pCompartment->getChildObjectUnits(pCompartment->getInitialValueReference());
134  }
135  break;
136 
137  case Species:
138  {
139  const CMetab * pSpecies = static_cast< const CMetab * >(mpObject);
140 
141  if (pSpecies == NULL)
142  {
143  return "";
144  }
145 
146  if (framework == Concentration)
147  {
148  return pSpecies->getChildObjectUnits(pSpecies->getInitialConcentrationReference());
149  }
150 
151  return pSpecies->getChildObjectUnits(pSpecies->getInitialValueReference());
152  }
153  break;
154 
155  case ModelValue:
156  break;
157 
158  case ReactionParameter:
159  {
160  const CReaction * pReaction = static_cast< const CModelParameterReactionParameter * >(this)->getReaction();
161 
162  if (pReaction == NULL)
163  {
164  return "";
165  }
166 
167  const CModel * pModel = getModel();
168 
169  CFindDimensions Units(pReaction->getFunction(),
175 
176  Units.setUseHeuristics(true);
177 
178  Units.setChemicalEquation(&pReaction->getChemEq());
179 
180  Units.findDimensions(pReaction->getCompartmentNumber() > 1);
181 
182  return Units.getDimensions()[pReaction->getParameterIndex(getName())].getDisplayString(pModel);
183  }
184  break;
185 
186  default:
187  break;
188  }
189 
190  return "";
191 }
192 
193 // virtual
195 {
196  mCN = cn;
197 }
198 
200 {
201  return mCN;
202 }
203 
205 {
206  bool success = true;
207 
208  switch (mType)
209  {
210  case Model:
211  success = (simulationType == CModelEntity::TIME);
212  break;
213 
214  case Species:
215  success = (simulationType != CModelEntity::TIME);
216  break;
217 
218  case ReactionParameter:
219  success = (simulationType == CModelEntity::FIXED ||
220  simulationType == CModelEntity::ASSIGNMENT);
221  break;
222 
223  case ModelValue:
224  case Compartment:
225  success = (simulationType != CModelEntity::TIME &&
226  simulationType != CModelEntity::REACTIONS);
227  break;
228 
229  default:
230  success = (simulationType == CModelEntity::FIXED);
231  break;
232  }
233 
234  if (success)
235  {
236  mSimulationType = simulationType;
237  }
238 
239  return success;
240 }
241 
243 {
244  return mSimulationType;
245 }
246 
247 // virtual
248 void CModelParameter::setValue(const C_FLOAT64 & value, const Framework & /* framework */)
249 {
250  mValue = value;
251 
252  CModelParameterSet * pSet = getSet();
253 
254  if (pSet->isActive())
255  {
256  updateModel();
257  }
258 }
259 
260 // virtual
261 const C_FLOAT64 & CModelParameter::getValue(const Framework & /* framework */) const
262 {
263  return mValue;
264 }
265 
266 void CModelParameter::setInitialExpression(const std::string & initialExpression)
267 {
268  if (initialExpression == "")
269  {
271  return;
272  }
273 
274  if (mpInitialExpression == NULL)
275  {
276  mpInitialExpression = new CExpression("InitialExpression", getSet());
277  }
278 
279  mpInitialExpression->setInfix(initialExpression);
280 }
281 
283 {
284  return mpInitialExpression;
285 }
286 
288 {
289  if (mpInitialExpression == NULL)
290  {
291  return "";
292  }
293 
294  return mpInitialExpression->getInfix();
295 }
296 
298 {
299  mCompareResult = compareResult;
300 }
301 
303 {
304  return mCompareResult;
305 }
306 
308 {
311 
312  size_t Index = 0;
313 
314  for (; it != end; ++it, ++Index)
315  {
316  if (*it == this) return Index;
317  }
318 
319  return C_INVALID_INDEX;
320 }
321 
323 {
324  if (mType == Reaction ||
325  mType == Group ||
326  mType == Set ||
327  (mType == Model && getModel()->isAutonomous()) ||
329  {
330  return true;
331  }
332 
333  return false;
334 }
335 
337 {
338  return mpObject;
339 }
340 
342 {
343  if (mType == Set)
344  {
345  return static_cast< CModelParameterSet * >(const_cast< CModelParameter * >(this));
346  }
347 
348  CModelParameterGroup * pParent = mpParent;
349 
350  while (pParent != NULL)
351  {
352  if (pParent->getType() == Set)
353  {
354  return static_cast< CModelParameterSet * >(pParent);
355  }
356 
357  pParent = pParent->getParent();
358  }
359 
360  return NULL;
361 }
362 
364 {
365  CModelParameterSet * pSet = getSet();
366 
367  if (pSet != NULL)
368  {
369  return pSet->getModel();
370  }
371 
372  return NULL;
373 }
374 
376 {
378 }
379 
380 // virtual
381 std::string CModelParameter::getName() const
382 {
383  if (mpObject != NULL)
384  {
385  return mpObject->getObjectName();
386  }
387 
388  return nameFromCN(mCN);
389 }
390 
392 {
393  mpObject = NULL;
395 
396  CModel * pModel = getModel();
397 
398  assert(pModel != NULL);
399 
400  std::vector< CCopasiContainer * > ListOfContainer;
401  ListOfContainer.push_back(pModel);
402 
403  mpObject = pModel->getObjectDataModel()->ObjectFromName(ListOfContainer, mCN);
404 
405  if (mpObject != NULL)
406  {
407  if (mType == unknown)
408  {
409  if (dynamic_cast< CModel * >(mpObject) != NULL)
410  mType = Model;
411  else if (dynamic_cast< CCompartment * >(mpObject) != NULL)
412  mType = Compartment;
413  else if (dynamic_cast< CMetab * >(mpObject) != NULL)
414  mType = Species;
415  else if (dynamic_cast< CModelValue * >(mpObject) != NULL)
416  mType = ModelValue;
417  else if (dynamic_cast< CCopasiParameter * >(mpObject) != NULL)
419  }
420  }
421 
422  if (mpInitialExpression != NULL)
423  {
425  }
426 }
427 
429  const CModelParameter::Framework & framework,
430  const bool & /* createMissing */)
431 {
432  if (mCompareResult == Missing ||
434  {
435  return mCompareResult;
436  }
437 
438  switch (mType)
439  {
440  case Compartment:
441  case Species:
442  case ModelValue:
443 
444  if (other.getObject() != NULL &&
445  mpObject != NULL &&
446  static_cast< CModelEntity *>(mpObject)->getStatus() == CModelEntity::ASSIGNMENT &&
447  (fabs(getValue(ParticleNumbers) - other.getValue(ParticleNumbers)) > 50 * (fabs(getValue(ParticleNumbers)) + fabs(other.getValue(ParticleNumbers))) * std::numeric_limits< C_FLOAT64 >::epsilon() ||
448  getInitialExpression() != ""))
449  {
451  return mCompareResult;
452  }
453 
454  break;
455 
456  default:
457  break;
458  }
459 
460  if (getInitialExpression() != other.getInitialExpression() ||
461  fabs(getValue(framework) - other.getValue(framework)) > 50 * (fabs(getValue(framework)) + fabs(other.getValue(framework))) * std::numeric_limits< C_FLOAT64 >::epsilon())
462  {
464  }
465  else
466  {
468  }
469 
470  return mCompareResult;
471 }
472 
473 // virtual
475 {
476  bool success = true;
477 
478  if (mpObject != NULL)
479  {
480  switch (mType)
481  {
482  case Model:
483  {
484  CModel * pModel = static_cast< CModel * >(mpObject);
485 
486  if (!pModel->isAutonomous())
487  {
488  pModel->setInitialValue(mValue);
489  }
490  else
491  {
492  pModel->setInitialValue(0.0);
493  }
494  }
495  break;
496 
497  case Compartment:
498  case Species:
499  case ModelValue:
500  {
501  CModelEntity * pEntity = static_cast< CModelEntity * >(mpObject);
502 
503  if (pEntity->getStatus() != CModelEntity::ASSIGNMENT)
504  {
505  pEntity->setInitialValue(mValue);
506 
508  {
510  }
511  }
512  }
513  break;
514 
515  case ReactionParameter:
516  {
517  CCopasiParameter * pParameter = static_cast< CCopasiParameter * >(mpObject);
518  CReaction * pReaction = static_cast< CReaction * >(mpObject->getObjectAncestor("Reaction"));
519 
521  getInitialExpression() != "")
522  {
523  CModel * pModel = mpParent->getModel();
524 
525  assert(pModel != NULL);
526 
527  std::vector< CCopasiContainer * > ListOfContainer;
528  ListOfContainer.push_back(pModel);
529 
530  CCopasiObjectName CN = static_cast< CEvaluationNodeObject * >(mpInitialExpression->getRoot())->getObjectCN();
531  CCopasiObject * pObject = pModel->getObjectDataModel()->ObjectFromName(ListOfContainer, CN);
532 
533  assert(pObject != NULL);
534 
535  // We assign the object value
536  pParameter->setValue(* (C_FLOAT64 *) pObject->getValuePointer());
537 
538  // We map the parameter to the global quantity
539  pReaction->setParameterMapping(pParameter->getObjectName(), pObject->getObjectParent()->getKey());
540  }
541  else
542  {
543  pParameter->setValue(mValue);
544 
545  // We need to remove the existing mapping to a global quantity1.
546  pReaction->setParameterMapping(pParameter->getObjectName(), pParameter->getKey());
547  }
548  }
549  break;
550 
551  default:
552  success = false;
553  break;
554  }
555  }
556 
557  return success;
558 }
559 
560 // virtual
561 bool CModelParameter::refreshFromModel(const bool & modifyExistence)
562 {
563  bool success = true;
564 
565  if (modifyExistence)
566  {
568  {
569  delete this;
570 
571  return true;
572  }
573 
575  {
577  }
578 
579  if (mType != ReactionParameter &&
580  mpObject != NULL)
581  {
582  mSimulationType = static_cast< CModelEntity * >(mpObject)->getStatus();
583  }
584  }
585 
586  if (mpObject != NULL)
587  {
588  switch (mType)
589  {
590  case Model:
591  {
592  CModel * pModel = static_cast< CModel * >(mpObject);
593 
594  if (!pModel->isAutonomous())
595  {
596  mValue = pModel->getInitialValue();
597  }
598  else
599  {
600  mValue = 0.0;
601  }
602  }
603  break;
604 
605  case Compartment:
606  case Species:
607  case ModelValue:
608  {
609  CModelEntity * pEntity = static_cast< CModelEntity * >(mpObject);
610 
611  mValue = pEntity->getInitialValue();
612  }
613  break;
614 
615  case ReactionParameter:
616  {
617  CCopasiParameter * pParameter = static_cast< CCopasiParameter * >(mpObject);
618  mValue = * pParameter->getValue().pDOUBLE;
619 
620  // We need to update the mapping
621  // Check whether this refers to a global quantity.
622  const CReaction * pReaction = static_cast< CModelParameterReactionParameter * >(this)->getReaction();
623 
624  if (pReaction != NULL)
625  {
626  if (pReaction->isLocalParameter(getName()))
627  {
629  static_cast< CModelParameterReactionParameter * >(this)->setGlobalQuantityCN("");
630  }
631  else
632  {
634  const std::vector<std::string> ModelValue = pReaction->getParameterMapping(getName());
635 
636  assert(ModelValue.size() == 1);
637 
638  CModelValue * pModelValue = static_cast< CModelValue * >(CCopasiRootContainer::getKeyFactory()->get(ModelValue[0]));
639  static_cast< CModelParameterReactionParameter * >(this)->setGlobalQuantityCN(pModelValue->getInitialValueReference()->getCN());
640  }
641  }
642 
643  CCopasiObjectName GlobalQuantityCN = static_cast< CModelParameterReactionParameter * >(this)->getGlobalQuantityCN();
644 
645  if (GlobalQuantityCN != "")
646  {
647  CModelParameter * pGlobalQuantity = getSet()->getModelParameter(GlobalQuantityCN);
648 
649  if (pGlobalQuantity != NULL)
650  {
651  mValue = pGlobalQuantity->getValue(ParticleNumbers);
652  }
653  }
654  }
655  break;
656 
657  default:
658  success = false;
659  break;
660  }
661  }
662 
663  return success;
664 }
665 
666 // virtual
668 {
669  return 0;
670 }
671 
672 // virtual
673 const CModelParameter * CModelParameter::getChild(const size_t & /* index */) const
674 {
675  return NULL;
676 }
677 
679  CModelParameter(pParent, type),
680  mSpecies()
681 {}
682 
684  CModelParameter(src, pParent),
685  mSpecies()
686 {}
687 
688 // virtual
690 {
691  // If a compartment is deleted all contained species are not deleted however
692  // their compartment is set to NULL.
693  std::set< CModelParameterSpecies * >::iterator it = mSpecies.begin();
694  std::set< CModelParameterSpecies * >::iterator end = mSpecies.end();
695 
696  for (; it != end; ++it)
697  {
698  (*it)->mpCompartment = NULL;
699  }
700 }
701 
702 // virtual
703 void CModelParameterCompartment::setValue(const C_FLOAT64 & value, const Framework & framework)
704 {
705  CVector< C_FLOAT64 > SpeciesValues(mSpecies.size());
706  C_FLOAT64 * pSpeciesValue = SpeciesValues.array();
707 
708  std::set< CModelParameterSpecies * >::iterator it = mSpecies.begin();
709  std::set< CModelParameterSpecies * >::iterator end = mSpecies.end();
710 
711  for (; it != end; ++it, ++pSpeciesValue)
712  {
713  *pSpeciesValue = (*it)->getValue(framework);
714  }
715 
716  mValue = value;
717 
718  pSpeciesValue = SpeciesValues.array();
719  it = mSpecies.begin();
720 
721  for (; it != end; ++it, ++pSpeciesValue)
722  {
723  (*it)->setValue(*pSpeciesValue, framework);
724  }
725 }
726 
728 {
729  mSpecies.insert(pSpecies);
730 }
731 
733 {
734  mSpecies.erase(pSpecies);
735 }
736 
738  CModelParameter(pParent, type),
739  mCompartmentCN(),
740  mpCompartment(NULL),
741  mConcentration(std::numeric_limits< C_FLOAT64 >::quiet_NaN())
742 {}
743 
745  CModelParameter(src, pParent),
746  mCompartmentCN(src.mCompartmentCN),
747  mpCompartment(NULL),
748  mConcentration(src.mConcentration)
749 {}
750 
751 // virtual
753 {
754  if (mpCompartment != NULL)
755  {
757  }
758 }
759 
760 // virtual
762 {
763  CModel * pModel = getSet()->getModel();
764 
765  if (mpObject != NULL)
766  {
767  return CMetabNameInterface::getDisplayName(pModel, *static_cast< CMetab * >(mpObject), false);
768  }
769 
770  return nameFromCN(mCN) + '{' + nameFromCN(mCompartmentCN) + '}';
771 }
772 
773 // virtual
775 {
777 
779 
780  if (mpCompartment != NULL)
781  {
782  mpCompartment->addSpecies(this);
783  }
784 
785  // Update the concentration if possible
787 }
788 
789 // virtual
791 {
793 
794  // Determine the CN for the compartment.
795  // "CN=Root,Model=New Model,Vector=Compartments[compartment],Vector=Metabolites[A]"
796  CCopasiObjectName Tmp = mCN;
797  std::string Separator = "";
798 
799  for (; Tmp != ""; Tmp = Tmp.getRemainder())
800  {
801  CCopasiObjectName Primary = Tmp.getPrimary();
802  mCompartmentCN += Separator + Primary;
803  Separator = ",";
804 
805  if (Primary.getObjectType() == "Vector" &&
806  Primary.getObjectName() == "Compartments")
807  {
808  break;
809  }
810  }
811 }
812 
813 // virtual
814 void CModelParameterSpecies::setValue(const C_FLOAT64 & value, const Framework & framework)
815 {
816  CModel * pModel = getModel();
817 
818  if (framework == Concentration)
819  {
820  mConcentration = value;
821 
822  if (mpCompartment != NULL && pModel != NULL)
823  {
825  }
826  else
827  {
828  mValue = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
829  }
830  }
831  else
832  {
833  mValue = value;
834 
835  if (mpCompartment != NULL && pModel != NULL)
836  {
838  }
839  else
840  {
841  mConcentration = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
842  }
843  }
844 }
845 
846 // virtual
847 const C_FLOAT64 & CModelParameterSpecies::getValue(const Framework & framework) const
848 {
849  if (framework == Concentration)
850  {
851  return mConcentration;
852  }
853 
854  return mValue;
855 }
856 
858 {
859  return mCompartmentCN;
860 }
861 
862 std::ostream &operator<<(std::ostream &os, const CModelParameter & o)
863 {
864  os << "Model Parameter:" << std::endl;
865  os << " Type: " << CModelParameter::TypeNames[o.mType] << std::endl;
866  os << " CN: " << o.mCN << std::endl;
867  os << " Value: " << o.mValue << std::endl;
868  os << " Expression: " << o.getInitialExpression() << std::endl;
869  os << " Diff: " << o.mCompareResult << std::endl;
870 
871  return os;
872 }
873 
875  CModelParameter(pParent, type),
876  mpReaction(NULL),
877  mGlobalQuantityCN(),
878  mpGlobalQuantity(NULL)
879 {}
880 
882  CModelParameter(src, pParent),
883  mpReaction(NULL),
884  mGlobalQuantityCN(src.mGlobalQuantityCN),
885  mpGlobalQuantity(NULL)
886 {}
887 
888 // virtual
890 {}
891 
892 // virtual
894 {
896 
897  mGlobalQuantityCN = std::string();
898 
899  std::string Infix = getInitialExpression();
900 
901  if (Infix.length() > 2)
902  {
903  // Infix: <CN,Reference=InitialValue> or <CN,Reference=Value>
904  CCopasiObjectName Tmp = Infix.substr(1, Infix.length() - 2);
905  std::string Separator = "";
906 
907  for (; Tmp != ""; Tmp = Tmp.getRemainder())
908  {
909  CCopasiObjectName Primary = Tmp.getPrimary();
910 
911  if (Primary.getObjectType() == "Reference")
912  {
913  break;
914  }
915 
916  mGlobalQuantityCN += Separator + Primary;
917  Separator = ",";
918  }
919 
921  }
922  else
923  {
925  }
926 
928 
929  if (mpGlobalQuantity != NULL)
930  {
932  }
933 
934  std::vector< CCopasiContainer * > ListOfContainer;
935 
936  CModel * pModel = getModel();
937  ListOfContainer.push_back(pModel);
938 
939  mpReaction = static_cast< CReaction * >(pModel->getObjectDataModel()->ObjectFromName(ListOfContainer, mpParent->getCN()));
940 }
941 
943 {
944  return mpReaction;
945 }
946 
947 void CModelParameterReactionParameter::setGlobalQuantityCN(const std::string & globalQuantityCN)
948 {
949  if (globalQuantityCN == "")
950  {
952  }
953  else
954  {
955  setInitialExpression("<" + globalQuantityCN + ">");
956  }
957 
958  compile();
959 }
960 
962 {
963  return mGlobalQuantityCN;
964 }
Header file of class CExpression.
CCopasiDataModel * getObjectDataModel()
CCopasiContainer * getObjectAncestor(const std::string &type) const
CModel::AreaUnit getAreaUnitEnum() const
Definition: CModel.cpp:2198
std::string getInitialExpression() const
static std::string nameFromCN(const CCopasiObjectName &cn)
virtual bool setInfix(const std::string &infix)
Definition: CExpression.cpp:63
#define pdelete(p)
Definition: copasi.h:215
CModelParameterGroup * mpParent
bool setValue(const CType &value)
CCopasiObject * mpObject
std::string getTimeUnitsDisplayString() const
Definition: CModel.cpp:4531
virtual std::string getName() const
const CompareResult & getCompareResult() const
const std::string & getObjectName() const
virtual std::string getName() const
CCopasiObjectName getRemainder() const
virtual const CModelParameter * getChild(const size_t &index) const
CModel::QuantityUnit getQuantityUnitEnum() const
Definition: CModel.cpp:2331
CCopasiObject * get(const std::string &key)
CCopasiObject * getInitialValueReference() const
CModelParameterCompartment * mpCompartment
CModelParameter * getModelParameter(const std::string &cn) const
bool mIsInitialExpressionValid
void addSpecies(CModelParameterSpecies *pSpecies)
void removeSpecies(CModelParameterSpecies *pSpecies)
bool isLocalParameter(const size_t &index) const
Definition: CReaction.cpp:449
static const char * TypeNames[]
CModelParameterCompartment(CModelParameterGroup *pParent, const CModelParameter::Type &type=CModelParameter::Compartment)
void setCompareResult(const CompareResult &compareResult)
bool setInitialExpression(const std::string &expression)
#define C_INVALID_INDEX
Definition: copasi.h:222
std::set< CModelParameterSpecies * > mSpecies
std::string getObjectType() const
virtual bool compile(std::vector< CCopasiContainer * > listOfContainer=CCopasiContainer::EmptyList)
Definition: CExpression.cpp:97
static std::string getDisplayName(const CModel *model, const std::string &key, const bool &quoted)
const std::string getUnit(const Framework &framework) const
const CCopasiObjectName & getCN() const
Definition: CMetab.h:178
void setUseHeuristics(bool flag)
Definition: CDimension.cpp:330
CCopasiObject * getObject() const
CExpression * mpInitialExpression
void setInitialExpression(const std::string &initialExpression)
CCopasiObjectName getPrimary() const
virtual const std::string & getKey() const
void setParent(CModelParameterGroup *pParent)
virtual const CompareResult & diff(const CModelParameter &other, const CModelParameter::Framework &framework=ParticleNumbers, const bool &createMissing=false)
const C_FLOAT64 & getInitialValue() const
virtual void compile()
virtual std::string getChildObjectUnits(const CCopasiObject *pObject) const
const CFunction * getFunction() const
Definition: CReaction.cpp:252
virtual void setValue(const C_FLOAT64 &value, const Framework &framework)
bool isReadOnly() const
const C_FLOAT64 & getQuantity2NumberFactor() const
Definition: CModel.cpp:2354
virtual void setValue(const double &value, const Framework &framework)
const C_FLOAT64 & getNumber2QuantityFactor() const
Definition: CModel.cpp:2357
size_t getParameterIndex(const std::string &parameterName, CFunctionParameter::DataType *pType=NULL) const
Definition: CReaction.cpp:292
virtual bool updateModel()
virtual const std::string & getKey() const
const bool & isAutonomous() const
Definition: CModel.cpp:3956
CModelParameterSet * getSet() const
virtual size_t getNumChildren() const
const Value & getValue() const
std::string getElementName(const size_t &pos, const bool &unescape=true) const
CRegisteredObjectName mGlobalQuantityCN
CModel::LengthUnit getLengthUnitEnum() const
Definition: CModel.cpp:2220
CModelEntity::Status mSimulationType
virtual const double & getValue(const Framework &framework) const
void setGlobalQuantityCN(const std::string &globalQuantityCN)
CModelParameterReactionParameter(CModelParameterGroup *pParent, const CModelParameter::Type &type=CModelParameter::ReactionParameter)
CCopasiObjectName getCompartmentCN() const
virtual const C_FLOAT64 & getValue(const Framework &framework) const
virtual std::string getChildObjectUnits(const CCopasiObject *pObject) const
Definition: CMetab.cpp:118
virtual bool refreshFromModel(const bool &modifyExistence)
const CModelEntity::Status & getSimulationType() const
CModelParameterSpecies(CModelParameterGroup *pParent, const CModelParameter::Type &type=CModelParameter::Species)
CompareResult mCompareResult
CModel::TimeUnit getTimeUnitEnum() const
Definition: CModel.cpp:2243
static CKeyFactory * getKeyFactory()
CRegisteredObjectName mCompartmentCN
const CExpression * getInitialExpressionPtr() const
#define C_FLOAT64
Definition: copasi.h:92
void remove(CModelParameter *pModelParameter)
CType * array()
Definition: CVector.h:139
std::vector< CModelParameter * >::const_iterator const_iterator
void setParameterMapping(const size_t &index, const std::string &key)
Definition: CReaction.cpp:339
size_t getCompartmentNumber() const
Definition: CReaction.cpp:873
virtual void setCN(const CCopasiObjectName &cn)
virtual ~CModelParameter()
bool isInitialExpressionValid() const
virtual void setInitialValue(const C_FLOAT64 &initialValue)
virtual void * getValuePointer() const
Definition: CModel.h:50
const Type & getType() const
size_t getIndex() const
const CReaction * getReaction() const
const CModelEntity::Status & getStatus() const
CModel::VolumeUnit getVolumeUnitEnum() const
Definition: CModel.cpp:2175
CConcentrationReference * getInitialConcentrationReference() const
Definition: CMetab.cpp:861
bool setSimulationType(const CModelEntity::Status &simulationType)
virtual void setValue(const C_FLOAT64 &value, const Framework &framework)
std::string getObjectName() const
CCopasiObject * ObjectFromName(const std::vector< CCopasiContainer * > &listOfContainer, const CCopasiObjectName &CN) const
const CChemEq & getChemEq() const
Definition: CReaction.cpp:223
CEvaluationNode * getRoot()
const CRegisteredObjectName & getGlobalQuantityCN() const
const std::string & getInfix() const
CCopasiContainer * getObjectParent() const
std::ostream & operator<<(std::ostream &os, const CModelParameter &o)
CModel * getModel() const
CRegisteredObjectName mCN
virtual void setCN(const CCopasiObjectName &cn)
const std::vector< std::string > & getParameterMapping(const size_t &index) const
Definition: CReaction.cpp:432
CModelParameterGroup * getParent() const
CModel * getModel() const