COPASI API  4.16.103
test000059.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 #include "test000059.h"
12 
13 #include <sstream>
14 #include "utilities.hpp"
16 #include "copasi/model/CModel.h"
19 
20 #include "sbml/SBMLDocument.h"
21 #include "sbml/Model.h"
22 #include "sbml/Rule.h"
23 #include "sbml/Species.h"
24 #include "sbml/Parameter.h"
25 #include "sbml/math/ASTNode.h"
26 
28 
29 CCopasiDataModel* test000059::pCOPASIDATAMODEL = NULL;
30 
32 {
33  // Create the root container.
34  CCopasiRootContainer::init(0, NULL, false);
35  // Create the global data model.
37 }
38 
40 {
42 }
43 
44 bool test000059::checkIfIdsUnique(const Model* pSBMLModel)
45 {
46  bool result = true;
47  std::set<std::string> ids;
48 
49  if (pSBMLModel != NULL)
50  {
51  // the model itself
52  const SBase* pSBase = NULL;
53  std::string id;
54 
55  if (pSBMLModel->isSetId())
56  {
57  id = pSBMLModel->getId();
58 
59  if (ids.find(id) == ids.end())
60  {
61  ids.insert(id);
62  }
63  else
64  {
65  result = false;
66  }
67  }
68 
69  // ListOfFunctionDefinitions
70  pSBase = pSBMLModel->getListOfFunctionDefinitions();
71 
72  if (pSBase != NULL)
73  {
74  if (pSBase->isSetId())
75  {
76  id = pSBase->getId();
77 
78  if (ids.find(id) == ids.end())
79  {
80  ids.insert(id);
81  }
82  else
83  {
84  result = false;
85  }
86  }
87 
88  unsigned int i, iMax = pSBMLModel->getListOfFunctionDefinitions()->size();
89 
90  for (i = 0; i < iMax; ++i)
91  {
92  pSBase = pSBMLModel->getListOfFunctionDefinitions()->get(i);
93 
94  if (pSBase->isSetId())
95  {
96  id = pSBase->getId();
97 
98  if (ids.find(id) == ids.end())
99  {
100  ids.insert(id);
101  }
102  else
103  {
104  result = false;
105  }
106  }
107  }
108  }
109 
110  // ListOfCompartmentTypes
111  pSBase = pSBMLModel->getListOfCompartmentTypes();
112 
113  if (pSBase != NULL)
114  {
115  if (pSBase->isSetId())
116  {
117  id = pSBase->getId();
118 
119  if (ids.find(id) == ids.end())
120  {
121  ids.insert(id);
122  }
123  else
124  {
125  result = false;
126  }
127  }
128 
129  // each compartment type
130  unsigned int i, iMax = pSBMLModel->getListOfCompartmentTypes()->size();
131 
132  for (i = 0; i < iMax; ++i)
133  {
134  pSBase = pSBMLModel->getCompartmentType(i);
135  assert(pSBase != NULL);
136 
137  if (pSBase->isSetId())
138  {
139  id = pSBase->getId();
140 
141  if (ids.find(id) == ids.end())
142  {
143  ids.insert(id);
144  }
145  else
146  {
147  result = false;
148  }
149  }
150  }
151  }
152 
153  // ListOfSpeciesTypes
154  pSBase = pSBMLModel->getListOfSpeciesTypes();
155 
156  if (pSBase != NULL)
157  {
158  if (pSBase->isSetId())
159  {
160  id = pSBase->getId();
161 
162  if (ids.find(id) == ids.end())
163  {
164  ids.insert(id);
165  }
166  else
167  {
168  result = false;
169  }
170  }
171 
172  // each species type
173  unsigned int i, iMax = pSBMLModel->getListOfSpeciesTypes()->size();
174 
175  for (i = 0; i < iMax; ++i)
176  {
177  pSBase = pSBMLModel->getSpeciesType(i);
178  assert(pSBase != NULL);
179 
180  if (pSBase->isSetId())
181  {
182  id = pSBase->getId();
183 
184  if (ids.find(id) == ids.end())
185  {
186  ids.insert(id);
187  }
188  else
189  {
190  result = false;
191  }
192  }
193  }
194  }
195 
196  // ListOfCompartments
197  pSBase = pSBMLModel->getListOfCompartments();
198 
199  if (pSBase != NULL)
200  {
201  if (pSBase->isSetId())
202  {
203  id = pSBase->getId();
204 
205  if (ids.find(id) == ids.end())
206  {
207  ids.insert(id);
208  }
209  else
210  {
211  result = false;
212  }
213  }
214 
215  // all compartments
216  unsigned int i, iMax = pSBMLModel->getListOfCompartments()->size();
217 
218  for (i = 0; i < iMax; ++i)
219  {
220  pSBase = pSBMLModel->getCompartment(i);
221  assert(pSBase != NULL);
222 
223  if (pSBase->isSetId())
224  {
225  id = pSBase->getId();
226 
227  if (ids.find(id) == ids.end())
228  {
229  ids.insert(id);
230  }
231  else
232  {
233  result = false;
234  }
235  }
236  }
237  }
238 
239  // ListOfSpecies
240  pSBase = pSBMLModel->getListOfSpecies();
241 
242  if (pSBase != NULL)
243  {
244  if (pSBase->isSetId())
245  {
246  id = pSBase->getId();
247 
248  if (ids.find(id) == ids.end())
249  {
250  ids.insert(id);
251  }
252  else
253  {
254  result = false;
255  }
256  }
257 
258  // all species
259  unsigned int i, iMax = pSBMLModel->getListOfSpecies()->size();
260 
261  for (i = 0; i < iMax; ++i)
262  {
263  pSBase = pSBMLModel->getSpecies(i);
264  assert(pSBase != NULL);
265 
266  if (pSBase->isSetId())
267  {
268  id = pSBase->getId();
269 
270  if (ids.find(id) == ids.end())
271  {
272  ids.insert(id);
273  }
274  else
275  {
276  result = false;
277  }
278  }
279  }
280  }
281 
282  // ListOfParameters
283  pSBase = pSBMLModel->getListOfParameters();
284 
285  if (pSBase != NULL)
286  {
287  if (pSBase->isSetId())
288  {
289  id = pSBase->getId();
290 
291  if (ids.find(id) == ids.end())
292  {
293  ids.insert(id);
294  }
295  else
296  {
297  result = false;
298  }
299  }
300 
301  // each parameter
302  unsigned int i, iMax = pSBMLModel->getListOfParameters()->size();
303 
304  for (i = 0; i < iMax; ++i)
305  {
306  pSBase = pSBMLModel->getParameter(i);
307  assert(pSBase != NULL);
308 
309  if (pSBase->isSetId())
310  {
311  id = pSBase->getId();
312 
313  if (ids.find(id) == ids.end())
314  {
315  ids.insert(id);
316  }
317  else
318  {
319  result = false;
320  }
321  }
322  }
323  }
324 
325  // ListOfInitialAssignments
326  pSBase = pSBMLModel->getListOfInitialAssignments();
327 
328  if (pSBase != NULL)
329  {
330  if (pSBase->isSetId())
331  {
332  id = pSBase->getId();
333 
334  if (ids.find(id) == ids.end())
335  {
336  ids.insert(id);
337  }
338  else
339  {
340  result = false;
341  }
342  }
343  }
344 
345  // ListOfRules
346  pSBase = pSBMLModel->getListOfRules();
347 
348  if (pSBase != NULL)
349  {
350  if (pSBase->isSetId())
351  {
352  id = pSBase->getId();
353 
354  if (ids.find(id) == ids.end())
355  {
356  ids.insert(id);
357  }
358  else
359  {
360  result = false;
361  }
362  }
363  }
364 
365  // ListOfConstraints
366  pSBase = pSBMLModel->getListOfConstraints();
367 
368  if (pSBase != NULL)
369  {
370  if (pSBase->isSetId())
371  {
372  id = pSBase->getId();
373 
374  if (ids.find(id) == ids.end())
375  {
376  ids.insert(id);
377  }
378  else
379  {
380  result = false;
381  }
382  }
383  }
384 
385  // ListOfReactions
386  pSBase = pSBMLModel->getListOfReactions();
387 
388  if (pSBase != NULL)
389  {
390  if (pSBase->isSetId())
391  {
392  id = pSBase->getId();
393 
394  if (ids.find(id) == ids.end())
395  {
396  ids.insert(id);
397  }
398  else
399  {
400  result = false;
401  }
402  }
403 
404  // all reactions
405  unsigned int i, iMax = pSBMLModel->getListOfReactions()->size();
406 
407  for (i = 0; i < iMax; ++i)
408  {
409  const Reaction* pReaction = pSBMLModel->getReaction(i);
410  assert(pReaction != NULL);
411 
412  if (pReaction->isSetId())
413  {
414  id = pReaction->getId();
415 
416  if (ids.find(id) == ids.end())
417  {
418  ids.insert(id);
419  }
420  else
421  {
422  result = false;
423  }
424  }
425 
426  // for each reaction: ListOfSubstrates, each substrate, ListOfProducts, each
427  // Product, ListOfModifieres, each modifier, KineticLaw, ListOfparameters,
428  // each parameter
429  if (pReaction->getListOfReactants() != NULL)
430  {
431  pSBase = pReaction->getListOfReactants();
432  unsigned int j, jMax = pReaction->getListOfReactants()->size();
433 
434  for (j = 0; j < jMax; ++j)
435  {
436  pSBase = pReaction->getReactant(j);
437  assert(pSBase != NULL);
438 
439  // since L2V2 species references can have ids
440  if (pSBase->isSetId())
441  {
442  id = pSBase->getId();
443 
444  if (ids.find(id) == ids.end())
445  {
446  ids.insert(id);
447  }
448  else
449  {
450  result = false;
451  }
452  }
453  }
454  }
455 
456  if (pReaction->getListOfProducts() != NULL)
457  {
458  pSBase = pReaction->getListOfProducts();
459  unsigned int j, jMax = pReaction->getListOfProducts()->size();
460 
461  for (j = 0; j < jMax; ++j)
462  {
463  pSBase = pReaction->getProduct(j);
464  assert(pSBase != NULL);
465 
466  // since L2V2 species references can have ids
467  if (pSBase->isSetId())
468  {
469  id = pSBase->getId();
470 
471  if (ids.find(id) == ids.end())
472  {
473  ids.insert(id);
474  }
475  else
476  {
477  result = false;
478  }
479  }
480  }
481  }
482 
483  if (pReaction->getListOfModifiers() != NULL)
484  {
485  pSBase = pReaction->getListOfModifiers();
486  unsigned int j, jMax = pReaction->getListOfModifiers()->size();
487 
488  for (j = 0; j < jMax; ++j)
489  {
490  pSBase = pReaction->getModifier(j);
491  assert(pSBase != NULL);
492 
493  // since L2V2 species references can have ids
494  if (pSBase->isSetId())
495  {
496  id = pSBase->getId();
497 
498  if (ids.find(id) == ids.end())
499  {
500  ids.insert(id);
501  }
502  else
503  {
504  result = false;
505  }
506  }
507  }
508  }
509  }
510  }
511 
512  // ListOfEvents
513  pSBase = pSBMLModel->getListOfEvents();
514 
515  if (pSBase != NULL)
516  {
517  if (pSBase->isSetId())
518  {
519  id = pSBase->getId();
520 
521  if (ids.find(id) == ids.end())
522  {
523  ids.insert(id);
524  }
525  else
526  {
527  result = false;
528  }
529  }
530  }
531  }
532 
533  /*
534  std::cout << "number of ids: " << ids.size() << std::endl;
535  std::set<std::string>::iterator it=ids.begin();
536  while(it!=ids.end())
537  {
538  std::cout << "id: " << *it << std::endl;
539  ++it;
540  }
541  */
542  return result;
543 }
544 
546 {
547  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
548  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING1));
549  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
550  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
551  const Model* pSBMLModel = pDocument->getModel();
552  CPPUNIT_ASSERT(pSBMLModel != NULL);
553  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
554  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
555  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
556  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
557  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
558  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
559  // now we add a new compartment
560  CModel* pModel = pDataModel->getModel();
561  CPPUNIT_ASSERT(pModel != NULL);
562  CCompartment* pCompartment = pModel->createCompartment("compartment_2");
563  CPPUNIT_ASSERT(pCompartment != NULL);
564  pModel->compileIfNecessary(NULL);
565  std::set<const CCopasiObject*> changedObjects;
566  const CCopasiObject* pObject = pCompartment->getInitialValueReference();
567  CPPUNIT_ASSERT(pObject != NULL);
568  changedObjects.insert(pObject);
569  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
570  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
571 
572  while (refreshIt != refreshEndit)
573  {
574  (**refreshIt++)();
575  }
576 
577  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
578  pDocument = pDataModel->getCurrentSBMLDocument();
579  pSBMLModel = pDocument->getModel();
580  CPPUNIT_ASSERT(pSBMLModel != NULL);
581  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
582  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 2);
583  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
584  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
585  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
586  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
587  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
588 }
589 
591 {
592  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
593  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING2));
594  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
595  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
596  const Model* pSBMLModel = pDocument->getModel();
597  CPPUNIT_ASSERT(pSBMLModel != NULL);
598  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
599  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
600  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
601  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
602  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
603  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
604  // now we add a new species
605  CModel* pModel = pDataModel->getModel();
606  CPPUNIT_ASSERT(pModel != NULL);
607  CMetab* pMetabolite = pModel->createMetabolite("species_2", "compartment_1", 1.0, CModelEntity::FIXED);
608  CPPUNIT_ASSERT(pMetabolite != NULL);
609  pModel->compileIfNecessary(NULL);
610  std::set<const CCopasiObject*> changedObjects;
611  const CCopasiObject* pObject = pMetabolite->getInitialConcentrationReference();
612  CPPUNIT_ASSERT(pObject != NULL);
613  changedObjects.insert(pObject);
614  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
615  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
616 
617  while (refreshIt != refreshEndit)
618  {
619  (**refreshIt++)();
620  }
621 
622  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
623  pDocument = pDataModel->getCurrentSBMLDocument();
624  pSBMLModel = pDocument->getModel();
625  CPPUNIT_ASSERT(pSBMLModel != NULL);
626  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
627  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
628  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 2);
629  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
630  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
631  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
632  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
633 }
634 
636 {
637  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
638  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING3));
639  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
640  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
641  const Model* pSBMLModel = pDocument->getModel();
642  CPPUNIT_ASSERT(pSBMLModel != NULL);
643  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
644  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
645  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
646  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
647  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
648  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
649  // now we add a new parameter
650  CModel* pModel = pDataModel->getModel();
651  CPPUNIT_ASSERT(pModel != NULL);
652  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
653  CPPUNIT_ASSERT(pModelValue != NULL);
654  pModel->compileIfNecessary(NULL);
655  std::set<const CCopasiObject*> changedObjects;
656  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
657  CPPUNIT_ASSERT(pObject != NULL);
658  changedObjects.insert(pObject);
659  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
660  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
661 
662  while (refreshIt != refreshEndit)
663  {
664  (**refreshIt++)();
665  }
666 
667  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
668  pDocument = pDataModel->getCurrentSBMLDocument();
669  pSBMLModel = pDocument->getModel();
670  CPPUNIT_ASSERT(pSBMLModel != NULL);
671  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
672  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
673  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
674  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
675  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
676  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
677  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
678 }
679 
681 {
682  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
683  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING4));
684  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
685  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
686  const Model* pSBMLModel = pDocument->getModel();
687  CPPUNIT_ASSERT(pSBMLModel != NULL);
688  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
689  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
690  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
691  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
692  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
693  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
694  // now we add a new reaction
695  CModel* pModel = pDataModel->getModel();
696  CPPUNIT_ASSERT(pModel != NULL);
697  CReaction* pReaction = pModel->createReaction("influx");
698  CPPUNIT_ASSERT(pReaction != NULL);
699  pReaction->addProduct(pModel->getMetabolites()[0]->getKey());
700  pReaction->setFunction("Constant flux (irreversible)");
701  pReaction->setParameterValue("v", 1.0, true);
702  pModel->compileIfNecessary(NULL);
703  std::set<const CCopasiObject*> changedObjects;
704  changedObjects.insert(pReaction->getParameters().getParameter(0)->getValueReference());
705  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
706  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
707 
708  while (refreshIt != refreshEndit)
709  {
710  (**refreshIt++)();
711  }
712 
713  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
714  pDocument = pDataModel->getCurrentSBMLDocument();
715  pSBMLModel = pDocument->getModel();
716  CPPUNIT_ASSERT(pSBMLModel != NULL);
717  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
718  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
719  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
720  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 2);
721  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
722  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
723  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
724 }
725 
727 {
728  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
729  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING5));
730  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
731  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
732  const Model* pSBMLModel = pDocument->getModel();
733  CPPUNIT_ASSERT(pSBMLModel != NULL);
734  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
735  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
736  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
737  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
738  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
739  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
740  // now we add a new species
741  CModel* pModel = pDataModel->getModel();
742  CPPUNIT_ASSERT(pModel != NULL);
743  CMetab* pMetabolite = pModel->createMetabolite("species_2", "compartment_1", 1.0, CModelEntity::FIXED);
744  CPPUNIT_ASSERT(pMetabolite != NULL);
745  pModel->compileIfNecessary(NULL);
746  std::set<const CCopasiObject*> changedObjects;
747  const CCopasiObject* pObject = pMetabolite->getInitialConcentrationReference();
748  CPPUNIT_ASSERT(pObject != NULL);
749  changedObjects.insert(pObject);
750  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
751  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
752 
753  while (refreshIt != refreshEndit)
754  {
755  (**refreshIt++)();
756  }
757 
758  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
759  pDocument = pDataModel->getCurrentSBMLDocument();
760  pSBMLModel = pDocument->getModel();
761  CPPUNIT_ASSERT(pSBMLModel != NULL);
762  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
763  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
764  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 2);
765  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
766  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
767  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
768  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
769 }
770 
772 {
773  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
774  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING6));
775  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
776  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
777  const Model* pSBMLModel = pDocument->getModel();
778  CPPUNIT_ASSERT(pSBMLModel != NULL);
779  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
780  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
781  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
782  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
783  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
784  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
785  // now we add a new parameter
786  CModel* pModel = pDataModel->getModel();
787  CPPUNIT_ASSERT(pModel != NULL);
788  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
789  CPPUNIT_ASSERT(pModelValue != NULL);
790  pModel->compileIfNecessary(NULL);
791  std::set<const CCopasiObject*> changedObjects;
792  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
793  CPPUNIT_ASSERT(pObject != NULL);
794  changedObjects.insert(pObject);
795  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
796  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
797 
798  while (refreshIt != refreshEndit)
799  {
800  (**refreshIt++)();
801  }
802 
803  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
804  pDocument = pDataModel->getCurrentSBMLDocument();
805  pSBMLModel = pDocument->getModel();
806  CPPUNIT_ASSERT(pSBMLModel != NULL);
807  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
808  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
809  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
810  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
811  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
812  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
813  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
814 }
815 
817 {
818  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
819  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING7));
820  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
821  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
822  const Model* pSBMLModel = pDocument->getModel();
823  CPPUNIT_ASSERT(pSBMLModel != NULL);
824  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
825  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
826  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
827  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
828  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
829  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
830  // now we add a new reaction
831  CModel* pModel = pDataModel->getModel();
832  CPPUNIT_ASSERT(pModel != NULL);
833  CReaction* pReaction = pModel->createReaction("influx");
834  CPPUNIT_ASSERT(pReaction != NULL);
835  pReaction->addProduct(pModel->getMetabolites()[0]->getKey());
836  pReaction->setFunction("Constant flux (irreversible)");
837  pReaction->setParameterValue("v", 1.0, true);
838  pModel->compileIfNecessary(NULL);
839  std::set<const CCopasiObject*> changedObjects;
840  changedObjects.insert(pReaction->getParameters().getParameter(0)->getValueReference());
841  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
842  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
843 
844  while (refreshIt != refreshEndit)
845  {
846  (**refreshIt++)();
847  }
848 
849  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
850  pDocument = pDataModel->getCurrentSBMLDocument();
851  pSBMLModel = pDocument->getModel();
852  CPPUNIT_ASSERT(pSBMLModel != NULL);
853  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
854  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
855  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
856  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 2);
857  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
858  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
859  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
860 }
861 
863 {
864  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
865  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING8));
866  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
867  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
868  const Model* pSBMLModel = pDocument->getModel();
869  CPPUNIT_ASSERT(pSBMLModel != NULL);
870  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
871  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
872  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
873  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
874  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
875  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
876  // now we add a new parameter
877  CModel* pModel = pDataModel->getModel();
878  CPPUNIT_ASSERT(pModel != NULL);
879  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
880  CPPUNIT_ASSERT(pModelValue != NULL);
881  pModel->compileIfNecessary(NULL);
882  std::set<const CCopasiObject*> changedObjects;
883  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
884  CPPUNIT_ASSERT(pObject != NULL);
885  changedObjects.insert(pObject);
886  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
887  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
888 
889  while (refreshIt != refreshEndit)
890  {
891  (**refreshIt++)();
892  }
893 
894  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
895  pDocument = pDataModel->getCurrentSBMLDocument();
896  pSBMLModel = pDocument->getModel();
897  CPPUNIT_ASSERT(pSBMLModel != NULL);
898  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
899  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
900  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
901  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
902  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
903  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
904  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
905 }
906 
908 {
909  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
910  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING9));
911  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
912  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
913  const Model* pSBMLModel = pDocument->getModel();
914  CPPUNIT_ASSERT(pSBMLModel != NULL);
915  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
916  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
917  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
918  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
919  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
920  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
921  // now we add a new reaction
922  CModel* pModel = pDataModel->getModel();
923  CPPUNIT_ASSERT(pModel != NULL);
924  CReaction* pReaction = pModel->createReaction("influx");
925  CPPUNIT_ASSERT(pReaction != NULL);
926  pReaction->addProduct(pModel->getMetabolites()[0]->getKey());
927  pReaction->setFunction("Constant flux (irreversible)");
928  pReaction->setParameterValue("v", 1.0, true);
929  pModel->compileIfNecessary(NULL);
930  std::set<const CCopasiObject*> changedObjects;
931  changedObjects.insert(pReaction->getParameters().getParameter(0)->getValueReference());
932  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
933  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
934 
935  while (refreshIt != refreshEndit)
936  {
937  (**refreshIt++)();
938  }
939 
940  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
941  pDocument = pDataModel->getCurrentSBMLDocument();
942  pSBMLModel = pDocument->getModel();
943  CPPUNIT_ASSERT(pSBMLModel != NULL);
944  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
945  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
946  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
947  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 2);
948  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
949  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
950  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
951 }
952 
954 {
955  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
956  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING10));
957  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
958  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
959  const Model* pSBMLModel = pDocument->getModel();
960  CPPUNIT_ASSERT(pSBMLModel != NULL);
961  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
962  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
963  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
964  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
965  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
966  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
967  // now we add a new reaction
968  CModel* pModel = pDataModel->getModel();
969  CPPUNIT_ASSERT(pModel != NULL);
970  CReaction* pReaction = pModel->createReaction("influx");
971  CPPUNIT_ASSERT(pReaction != NULL);
972  pReaction->addProduct(pModel->getMetabolites()[0]->getKey());
973  pReaction->setFunction("Constant flux (irreversible)");
974  pReaction->setParameterValue("v", 1.0, true);
975  pModel->compileIfNecessary(NULL);
976  std::set<const CCopasiObject*> changedObjects;
977  changedObjects.insert(pReaction->getParameters().getParameter(0)->getValueReference());
978  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
979  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
980 
981  while (refreshIt != refreshEndit)
982  {
983  (**refreshIt++)();
984  }
985 
986  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
987  pDocument = pDataModel->getCurrentSBMLDocument();
988  pSBMLModel = pDocument->getModel();
989  CPPUNIT_ASSERT(pSBMLModel != NULL);
990  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
991  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
992  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
993  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 2);
994  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
995  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
996  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
997 }
998 
1000 {
1001  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1002  std::istringstream iss(test000059::MODEL_STRING11);
1003  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1004  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1005  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1006  CPPUNIT_ASSERT(pDocument == NULL);
1007  // now we add a new species
1008  CModel* pModel = pDataModel->getModel();
1009  CPPUNIT_ASSERT(pModel != NULL);
1010  CMetab* pMetabolite = pModel->createMetabolite("species_2", "compartment_1", 1.0, CModelEntity::FIXED);
1011  CPPUNIT_ASSERT(pMetabolite != NULL);
1012  pModel->compileIfNecessary(NULL);
1013  std::set<const CCopasiObject*> changedObjects;
1014  const CCopasiObject* pObject = pMetabolite->getInitialConcentrationReference();
1015  CPPUNIT_ASSERT(pObject != NULL);
1016  changedObjects.insert(pObject);
1017  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1018  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1019 
1020  while (refreshIt != refreshEndit)
1021  {
1022  (**refreshIt++)();
1023  }
1024 
1025  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1026  pDocument = pDataModel->getCurrentSBMLDocument();
1027  const Model* pSBMLModel = pDocument->getModel();
1028  CPPUNIT_ASSERT(pSBMLModel != NULL);
1029  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
1030  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1031  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 2);
1032  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1033  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1034  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
1035  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1036 }
1037 
1039 {
1040  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1041  std::istringstream iss(test000059::MODEL_STRING12);
1042  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1043  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1044  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1045  CPPUNIT_ASSERT(pDocument == NULL);
1046  // now we add a new parameter
1047  CModel* pModel = pDataModel->getModel();
1048  CPPUNIT_ASSERT(pModel != NULL);
1049  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
1050  CPPUNIT_ASSERT(pModelValue != NULL);
1051  pModel->compileIfNecessary(NULL);
1052  std::set<const CCopasiObject*> changedObjects;
1053  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
1054  CPPUNIT_ASSERT(pObject != NULL);
1055  changedObjects.insert(pObject);
1056  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1057  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1058 
1059  while (refreshIt != refreshEndit)
1060  {
1061  (**refreshIt++)();
1062  }
1063 
1064  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1065  pDocument = pDataModel->getCurrentSBMLDocument();
1066  const Model* pSBMLModel = pDocument->getModel();
1067  CPPUNIT_ASSERT(pSBMLModel != NULL);
1068  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
1069  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1070  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1071  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1072  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1073  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
1074  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1075 }
1076 
1078 {
1079  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1080  std::istringstream iss(test000059::MODEL_STRING13);
1081  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1082  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1083  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1084  CPPUNIT_ASSERT(pDocument == NULL);
1085  // now we add a new reaction
1086  CModel* pModel = pDataModel->getModel();
1087  CPPUNIT_ASSERT(pModel != NULL);
1088  CReaction* pReaction = pModel->createReaction("influx");
1089  CPPUNIT_ASSERT(pReaction != NULL);
1090  pReaction->addProduct(pModel->getMetabolites()[0]->getKey());
1091  pReaction->setFunction("Constant flux (irreversible)");
1092  pReaction->setParameterValue("v", 1.0, true);
1093  pModel->compileIfNecessary(NULL);
1094  std::set<const CCopasiObject*> changedObjects;
1095  changedObjects.insert(pReaction->getParameters().getParameter(0)->getValueReference());
1096  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1097  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1098 
1099  while (refreshIt != refreshEndit)
1100  {
1101  (**refreshIt++)();
1102  }
1103 
1104  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1105  pDocument = pDataModel->getCurrentSBMLDocument();
1106  const Model* pSBMLModel = pDocument->getModel();
1107  CPPUNIT_ASSERT(pSBMLModel != NULL);
1108  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1109  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1110  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1111  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 2);
1112  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1113  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
1114  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1115 }
1116 
1118 {
1119  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1120  std::istringstream iss(test000059::MODEL_STRING14);
1121  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1122  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1123  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1124  CPPUNIT_ASSERT(pDocument == NULL);
1125  // now we add a new parameter
1126  CModel* pModel = pDataModel->getModel();
1127  CPPUNIT_ASSERT(pModel != NULL);
1128  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
1129  CPPUNIT_ASSERT(pModelValue != NULL);
1130  pModel->compileIfNecessary(NULL);
1131  std::set<const CCopasiObject*> changedObjects;
1132  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
1133  CPPUNIT_ASSERT(pObject != NULL);
1134  changedObjects.insert(pObject);
1135  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1136  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1137 
1138  while (refreshIt != refreshEndit)
1139  {
1140  (**refreshIt++)();
1141  }
1142 
1143  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1144  pDocument = pDataModel->getCurrentSBMLDocument();
1145  const Model* pSBMLModel = pDocument->getModel();
1146  CPPUNIT_ASSERT(pSBMLModel != NULL);
1147  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
1148  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1149  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1150  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1151  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1152  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
1153  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1154 }
1155 
1157 {
1158  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1159  std::istringstream iss(test000059::MODEL_STRING15);
1160  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1161  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1162  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1163  CPPUNIT_ASSERT(pDocument == NULL);
1164  // now we add a new reaction
1165  CModel* pModel = pDataModel->getModel();
1166  CPPUNIT_ASSERT(pModel != NULL);
1167  CReaction* pReaction = pModel->createReaction("influx");
1168  CPPUNIT_ASSERT(pReaction != NULL);
1169  pReaction->addProduct(pModel->getMetabolites()[0]->getKey());
1170  pReaction->setFunction("Constant flux (irreversible)");
1171  pReaction->setParameterValue("v", 1.0, true);
1172  pModel->compileIfNecessary(NULL);
1173  std::set<const CCopasiObject*> changedObjects;
1174  changedObjects.insert(pReaction->getParameters().getParameter(0)->getValueReference());
1175  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1176  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1177 
1178  while (refreshIt != refreshEndit)
1179  {
1180  (**refreshIt++)();
1181  }
1182 
1183  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1184  pDocument = pDataModel->getCurrentSBMLDocument();
1185  const Model* pSBMLModel = pDocument->getModel();
1186  CPPUNIT_ASSERT(pSBMLModel != NULL);
1187  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1188  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1189  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1190  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 2);
1191  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1192  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
1193  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1194 }
1195 
1197 {
1198  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1199  std::istringstream iss(test000059::MODEL_STRING16);
1200  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1201  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1202  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1203  CPPUNIT_ASSERT(pDocument == NULL);
1204  // now we add a new reaction
1205  CModel* pModel = pDataModel->getModel();
1206  CPPUNIT_ASSERT(pModel != NULL);
1207  CReaction* pReaction = pModel->createReaction("influx");
1208  CPPUNIT_ASSERT(pReaction != NULL);
1209  pReaction->addProduct(pModel->getMetabolites()[0]->getKey());
1210  pReaction->setFunction("Constant flux (irreversible)");
1211  pReaction->setParameterValue("v", 1.0, true);
1212  pModel->compileIfNecessary(NULL);
1213  std::set<const CCopasiObject*> changedObjects;
1214  changedObjects.insert(pReaction->getParameters().getParameter(0)->getValueReference());
1215  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1216  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1217 
1218  while (refreshIt != refreshEndit)
1219  {
1220  (**refreshIt++)();
1221  }
1222 
1223  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1224  pDocument = pDataModel->getCurrentSBMLDocument();
1225  const Model* pSBMLModel = pDocument->getModel();
1226  CPPUNIT_ASSERT(pSBMLModel != NULL);
1227  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1228  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1229  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1230  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 2);
1231  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1232  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
1233  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1234 }
1235 
1237 {
1238  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1239  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING17));
1240  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1241  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1242  const Model* pSBMLModel = pDocument->getModel();
1243  CPPUNIT_ASSERT(pSBMLModel != NULL);
1244  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
1245  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1246  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1247  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1248  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1249  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
1250  // now we add a new parameter
1251  CModel* pModel = pDataModel->getModel();
1252  CPPUNIT_ASSERT(pModel != NULL);
1253  // add a new function definition
1254  CFunction* pFunctionDefinition = new CFunction("function_2");
1255  CPPUNIT_ASSERT(pFunctionDefinition != NULL);
1256  CPPUNIT_ASSERT(pFunctionDefinition->setInfix("3 * 5") == true);
1257  pFunctionDefinition->compile();
1258  // add the function definition to the function database
1260  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
1261  CPPUNIT_ASSERT(pModelValue != NULL);
1262  pModelValue->setStatus(CModelEntity::ASSIGNMENT);
1263  CPPUNIT_ASSERT(pModelValue->setExpression(std::string(pFunctionDefinition->getObjectName() + "()")) == true);
1264  // now create a rule for the parameter
1265  pModel->compileIfNecessary(NULL);
1266  std::set<const CCopasiObject*> changedObjects;
1267  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
1268  CPPUNIT_ASSERT(pObject != NULL);
1269  changedObjects.insert(pObject);
1270  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1271  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1272 
1273  while (refreshIt != refreshEndit)
1274  {
1275  (**refreshIt++)();
1276  }
1277 
1278  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1279  pDocument = pDataModel->getCurrentSBMLDocument();
1280  pSBMLModel = pDocument->getModel();
1281  CPPUNIT_ASSERT(pSBMLModel != NULL);
1282  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1283  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1284  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1285  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1286  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 1);
1287  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
1288  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1289 }
1290 
1292 {
1293  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1294  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING18));
1295  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1296  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1297  const Model* pSBMLModel = pDocument->getModel();
1298  CPPUNIT_ASSERT(pSBMLModel != NULL);
1299  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
1300  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1301  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1302  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1303  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1304  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
1305  // now we add a new parameter
1306  CModel* pModel = pDataModel->getModel();
1307  CPPUNIT_ASSERT(pModel != NULL);
1308  // add a new function definition
1309  CFunction* pFunctionDefinition = new CFunction("function_2");
1310  CPPUNIT_ASSERT(pFunctionDefinition != NULL);
1311  CPPUNIT_ASSERT(pFunctionDefinition->setInfix("3 * 5") == true);
1312  pFunctionDefinition->compile();
1313  // add the function definition to the function database
1315  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
1316  CPPUNIT_ASSERT(pModelValue != NULL);
1317  pModelValue->setStatus(CModelEntity::ASSIGNMENT);
1318  CPPUNIT_ASSERT(pModelValue->setExpression(std::string(pFunctionDefinition->getObjectName() + "()")) == true);
1319  // now create a rule for the parameter
1320  pModel->compileIfNecessary(NULL);
1321  std::set<const CCopasiObject*> changedObjects;
1322  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
1323  CPPUNIT_ASSERT(pObject != NULL);
1324  changedObjects.insert(pObject);
1325  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1326  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1327 
1328  while (refreshIt != refreshEndit)
1329  {
1330  (**refreshIt++)();
1331  }
1332 
1333  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1334  pDocument = pDataModel->getCurrentSBMLDocument();
1335  pSBMLModel = pDocument->getModel();
1336  CPPUNIT_ASSERT(pSBMLModel != NULL);
1337  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1338  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1339  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1340  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1341  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 1);
1342  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
1343  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1344 }
1345 
1347 {
1348  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1349  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING19));
1350  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1351  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1352  const Model* pSBMLModel = pDocument->getModel();
1353  CPPUNIT_ASSERT(pSBMLModel != NULL);
1354  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
1355  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1356  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1357  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1358  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1359  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
1360  // now we add a new parameter
1361  CModel* pModel = pDataModel->getModel();
1362  CPPUNIT_ASSERT(pModel != NULL);
1363  // add a new function definition
1364  CFunction* pFunctionDefinition = new CFunction("function_2");
1365  CPPUNIT_ASSERT(pFunctionDefinition != NULL);
1366  CPPUNIT_ASSERT(pFunctionDefinition->setInfix("3 * 5") == true);
1367  pFunctionDefinition->compile();
1368  // add the function definition to the function database
1370  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
1371  CPPUNIT_ASSERT(pModelValue != NULL);
1372  pModelValue->setStatus(CModelEntity::ASSIGNMENT);
1373  CPPUNIT_ASSERT(pModelValue->setExpression(std::string(pFunctionDefinition->getObjectName() + "()")) == true);
1374  // now create a rule for the parameter
1375  pModel->compileIfNecessary(NULL);
1376  std::set<const CCopasiObject*> changedObjects;
1377  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
1378  CPPUNIT_ASSERT(pObject != NULL);
1379  changedObjects.insert(pObject);
1380  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1381  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1382 
1383  while (refreshIt != refreshEndit)
1384  {
1385  (**refreshIt++)();
1386  }
1387 
1388  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1389  pDocument = pDataModel->getCurrentSBMLDocument();
1390  pSBMLModel = pDocument->getModel();
1391  CPPUNIT_ASSERT(pSBMLModel != NULL);
1392  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1393  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1394  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1395  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1396  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 1);
1397  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
1398  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1399 }
1400 
1402 {
1403  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1404  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(test000059::MODEL_STRING20));
1405  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1406  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1407  const Model* pSBMLModel = pDocument->getModel();
1408  CPPUNIT_ASSERT(pSBMLModel != NULL);
1409  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 1);
1410  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1411  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1412  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1413  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 0);
1414  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 1);
1415  // now we add a new parameter
1416  CModel* pModel = pDataModel->getModel();
1417  CPPUNIT_ASSERT(pModel != NULL);
1418  // add a new function definition
1419  CFunction* pFunctionDefinition = new CFunction("function_2");
1420  CPPUNIT_ASSERT(pFunctionDefinition != NULL);
1421  CPPUNIT_ASSERT(pFunctionDefinition->setInfix("3 * 5") == true);
1422  pFunctionDefinition->compile();
1423  // add the function definition to the function database
1425  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
1426  CPPUNIT_ASSERT(pModelValue != NULL);
1427  pModelValue->setStatus(CModelEntity::ASSIGNMENT);
1428  CPPUNIT_ASSERT(pModelValue->setExpression(std::string(pFunctionDefinition->getObjectName() + "()")) == true);
1429  // now create a rule for the parameter
1430  pModel->compileIfNecessary(NULL);
1431  std::set<const CCopasiObject*> changedObjects;
1432  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
1433  CPPUNIT_ASSERT(pObject != NULL);
1434  changedObjects.insert(pObject);
1435  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1436  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1437 
1438  while (refreshIt != refreshEndit)
1439  {
1440  (**refreshIt++)();
1441  }
1442 
1443  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1444  pDocument = pDataModel->getCurrentSBMLDocument();
1445  pSBMLModel = pDocument->getModel();
1446  CPPUNIT_ASSERT(pSBMLModel != NULL);
1447  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1448  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1449  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1450  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1451  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 1);
1452  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
1453  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1454 }
1455 
1456 /**
1457  * Test for Bug 1060.
1458  */
1460 {
1461  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1462  std::istringstream iss(test000059::MODEL_STRING21);
1463  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1464  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1465  // now we add a new function definition
1466  CModel* pModel = pDataModel->getModel();
1467  CPPUNIT_ASSERT(pModel != NULL);
1468  // add a new function definition
1469  CFunction* pFunctionDefinition = new CFunction("test function");
1470  CPPUNIT_ASSERT(pFunctionDefinition != NULL);
1471  CPPUNIT_ASSERT(pFunctionDefinition->setInfix("3 * 5") == true);
1472  pFunctionDefinition->compile();
1473  // add the function definition to the function database
1475  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
1476  CPPUNIT_ASSERT(pModelValue != NULL);
1477  pModelValue->setStatus(CModelEntity::ASSIGNMENT);
1478  CPPUNIT_ASSERT(pModelValue->setExpression(std::string("\"" + pFunctionDefinition->getObjectName() + "\"()")) == true);
1479  // now create a rule for the parameter
1480  pModel->compileIfNecessary(NULL);
1481  std::set<const CCopasiObject*> changedObjects;
1482  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
1483  CPPUNIT_ASSERT(pObject != NULL);
1484  changedObjects.insert(pObject);
1485  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1486  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1487 
1488  while (refreshIt != refreshEndit)
1489  {
1490  (**refreshIt++)();
1491  }
1492 
1493  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1494  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1495  const Model* pSBMLModel = pDocument->getModel();
1496  CPPUNIT_ASSERT(pSBMLModel != NULL);
1497  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1498  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1499  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1500  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1501  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 1);
1502  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
1503  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1504 }
1505 
1506 /**
1507  * Same test as the test before, only the newly added function definition has a
1508  * different name.
1509  */
1511 {
1512  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1513  std::istringstream iss(test000059::MODEL_STRING21);
1514  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1515  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1516  // now we add a new function definition
1517  CModel* pModel = pDataModel->getModel();
1518  CPPUNIT_ASSERT(pModel != NULL);
1519  // add a new function definition
1520  CFunction* pFunctionDefinition = new CFunction("function_1");
1521  CPPUNIT_ASSERT(pFunctionDefinition != NULL);
1522  CPPUNIT_ASSERT(pFunctionDefinition->setInfix("3 * 5") == true);
1523  pFunctionDefinition->compile();
1524  // add the function definition to the function database
1526  CModelValue* pModelValue = pModel->createModelValue("parameter_2");
1527  CPPUNIT_ASSERT(pModelValue != NULL);
1528  pModelValue->setStatus(CModelEntity::ASSIGNMENT);
1529  CPPUNIT_ASSERT(pModelValue->setExpression(std::string(pFunctionDefinition->getObjectName() + "()")) == true);
1530  // now create a rule for the parameter
1531  pModel->compileIfNecessary(NULL);
1532  std::set<const CCopasiObject*> changedObjects;
1533  const CCopasiObject* pObject = pModelValue->getInitialValueReference();
1534  CPPUNIT_ASSERT(pObject != NULL);
1535  changedObjects.insert(pObject);
1536  std::vector<Refresh*> refreshes = pModel->buildInitialRefreshSequence(changedObjects);
1537  std::vector<Refresh*>::iterator refreshIt = refreshes.begin(), refreshEndit = refreshes.end();
1538 
1539  while (refreshIt != refreshEndit)
1540  {
1541  (**refreshIt++)();
1542  }
1543 
1544  CPPUNIT_ASSERT(pDataModel->exportSBMLToString(NULL, 2, 1).empty() == false);
1545  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1546  const Model* pSBMLModel = pDocument->getModel();
1547  CPPUNIT_ASSERT(pSBMLModel != NULL);
1548  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 2);
1549  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1550  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 1);
1551  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1552  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 1);
1553  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 2);
1554  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1555 }
1556 
1558 {
1559  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
1560  std::istringstream iss(test000059::MODEL_STRING22);
1561  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
1562  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1563  std::string modelString;
1564 
1565  try
1566  {
1567  modelString = pDataModel->exportSBMLToString(NULL, 2, 3);
1568  }
1569  catch (...)
1570  {
1571  CPPUNIT_ASSERT(false);
1572  }
1573 
1574  CPPUNIT_ASSERT(modelString.empty() == false);
1575 
1576  try
1577  {
1578  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(modelString));
1579  }
1580  catch (...)
1581  {
1582  CPPUNIT_ASSERT(false);
1583  }
1584 
1585  CPPUNIT_ASSERT(pDataModel->getModel() != NULL);
1586  const SBMLDocument* pDocument = pDataModel->getCurrentSBMLDocument();
1587  const Model* pSBMLModel = pDocument->getModel();
1588  CPPUNIT_ASSERT(pSBMLModel != NULL);
1589  CPPUNIT_ASSERT(pSBMLModel->getNumFunctionDefinitions() == 0);
1590  CPPUNIT_ASSERT(pSBMLModel->getNumCompartments() == 1);
1591  CPPUNIT_ASSERT(pSBMLModel->getNumSpecies() == 3);
1592  CPPUNIT_ASSERT(pSBMLModel->getNumReactions() == 1);
1593  CPPUNIT_ASSERT(pSBMLModel->getNumRules() == 1);
1594  CPPUNIT_ASSERT(pSBMLModel->getNumInitialAssignments() == 2);
1595  CPPUNIT_ASSERT(pSBMLModel->getNumParameters() == 5);
1596  // now we check if the ids are unique
1597  CPPUNIT_ASSERT(checkIfIdsUnique(pSBMLModel) == true);
1598 }
1599 
1600 const char* test000059::MODEL_STRING1 =
1601  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
1602  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
1603  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
1604  " <listOfFunctionDefinitions>\n"
1605  " <functionDefinition metaid=\"_000004\" id=\"compartment_2\" name=\"function_1\">\n"
1606  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1607  " <lambda>\n"
1608  " <bvar>\n"
1609  " <ci> k </ci>\n"
1610  " </bvar>\n"
1611  " <bvar>\n"
1612  " <ci> S </ci>\n"
1613  " </bvar>\n"
1614  " <apply>\n"
1615  " <times/>\n"
1616  " <ci> k </ci>\n"
1617  " <ci> S </ci>\n"
1618  " </apply>\n"
1619  " </lambda>\n"
1620  " </math>\n"
1621  " </functionDefinition>\n"
1622  " </listOfFunctionDefinitions> \n"
1623  " <listOfUnitDefinitions>\n"
1624  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
1625  " <listOfUnits>\n"
1626  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
1627  " </listOfUnits>\n"
1628  " </unitDefinition>\n"
1629  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
1630  " <listOfUnits>\n"
1631  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
1632  " </listOfUnits>\n"
1633  " </unitDefinition>\n"
1634  " </listOfUnitDefinitions> \n"
1635  " <listOfCompartments>\n"
1636  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
1637  " </compartment>\n"
1638  " </listOfCompartments>\n"
1639  " <listOfSpecies>\n"
1640  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
1641  " </listOfSpecies> \n"
1642  " <listOfParameters>\n"
1643  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
1644  " </listOfParameters>\n"
1645  " <listOfReactions>\n"
1646  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
1647  " <listOfReactants>\n"
1648  " <speciesReference species=\"species_1\"/>\n"
1649  " </listOfReactants>\n"
1650  " <kineticLaw>\n"
1651  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1652  " <apply>\n"
1653  " <times/>\n"
1654  " <ci> compartment_1 </ci>\n"
1655  " <apply>\n"
1656  " <ci> compartment_2 </ci>\n"
1657  " <ci> parameter_1 </ci>\n"
1658  " <ci> species_1 </ci>\n"
1659  " </apply>\n"
1660  " </apply>\n"
1661  " </math>\n"
1662  " </kineticLaw>\n"
1663  " </reaction>\n"
1664  " </listOfReactions>\n"
1665  " </model>\n"
1666  "</sbml>\n"
1667  ;
1668 
1669 const char* test000059::MODEL_STRING2 =
1670  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
1671  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
1672  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
1673  " <listOfFunctionDefinitions>\n"
1674  " <functionDefinition metaid=\"_000004\" id=\"species_2\" name=\"function_1\">\n"
1675  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1676  " <lambda>\n"
1677  " <bvar>\n"
1678  " <ci> k </ci>\n"
1679  " </bvar>\n"
1680  " <bvar>\n"
1681  " <ci> S </ci>\n"
1682  " </bvar>\n"
1683  " <apply>\n"
1684  " <times/>\n"
1685  " <ci> k </ci>\n"
1686  " <ci> S </ci>\n"
1687  " </apply>\n"
1688  " </lambda>\n"
1689  " </math>\n"
1690  " </functionDefinition>\n"
1691  " </listOfFunctionDefinitions> \n"
1692  " <listOfUnitDefinitions>\n"
1693  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
1694  " <listOfUnits>\n"
1695  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
1696  " </listOfUnits>\n"
1697  " </unitDefinition>\n"
1698  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
1699  " <listOfUnits>\n"
1700  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
1701  " </listOfUnits>\n"
1702  " </unitDefinition>\n"
1703  " </listOfUnitDefinitions> \n"
1704  " <listOfCompartments>\n"
1705  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
1706  " </compartment>\n"
1707  " </listOfCompartments>\n"
1708  " <listOfSpecies>\n"
1709  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
1710  " </listOfSpecies> \n"
1711  " <listOfParameters>\n"
1712  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
1713  " </listOfParameters>\n"
1714  " <listOfReactions>\n"
1715  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
1716  " <listOfReactants>\n"
1717  " <speciesReference species=\"species_1\"/>\n"
1718  " </listOfReactants>\n"
1719  " <kineticLaw>\n"
1720  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1721  " <apply>\n"
1722  " <times/>\n"
1723  " <ci> compartment_1 </ci>\n"
1724  " <apply>\n"
1725  " <ci> species_2 </ci>\n"
1726  " <ci> parameter_1 </ci>\n"
1727  " <ci> species_1 </ci>\n"
1728  " </apply>\n"
1729  " </apply>\n"
1730  " </math>\n"
1731  " </kineticLaw>\n"
1732  " </reaction>\n"
1733  " </listOfReactions>\n"
1734  " </model>\n"
1735  "</sbml>\n"
1736  ;
1737 
1738 const char* test000059::MODEL_STRING3 =
1739  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
1740  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
1741  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
1742  " <listOfFunctionDefinitions>\n"
1743  " <functionDefinition metaid=\"_000004\" id=\"parameter_2\" name=\"function_1\">\n"
1744  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1745  " <lambda>\n"
1746  " <bvar>\n"
1747  " <ci> k </ci>\n"
1748  " </bvar>\n"
1749  " <bvar>\n"
1750  " <ci> S </ci>\n"
1751  " </bvar>\n"
1752  " <apply>\n"
1753  " <times/>\n"
1754  " <ci> k </ci>\n"
1755  " <ci> S </ci>\n"
1756  " </apply>\n"
1757  " </lambda>\n"
1758  " </math>\n"
1759  " </functionDefinition>\n"
1760  " </listOfFunctionDefinitions> \n"
1761  " <listOfUnitDefinitions>\n"
1762  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
1763  " <listOfUnits>\n"
1764  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
1765  " </listOfUnits>\n"
1766  " </unitDefinition>\n"
1767  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
1768  " <listOfUnits>\n"
1769  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
1770  " </listOfUnits>\n"
1771  " </unitDefinition>\n"
1772  " </listOfUnitDefinitions> \n"
1773  " <listOfCompartments>\n"
1774  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
1775  " </compartment>\n"
1776  " </listOfCompartments>\n"
1777  " <listOfSpecies>\n"
1778  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
1779  " </listOfSpecies> \n"
1780  " <listOfParameters>\n"
1781  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
1782  " </listOfParameters>\n"
1783  " <listOfReactions>\n"
1784  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
1785  " <listOfReactants>\n"
1786  " <speciesReference species=\"species_1\"/>\n"
1787  " </listOfReactants>\n"
1788  " <kineticLaw>\n"
1789  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1790  " <apply>\n"
1791  " <times/>\n"
1792  " <ci> compartment_1 </ci>\n"
1793  " <apply>\n"
1794  " <ci> parameter_2 </ci>\n"
1795  " <ci> parameter_1 </ci>\n"
1796  " <ci> species_1 </ci>\n"
1797  " </apply>\n"
1798  " </apply>\n"
1799  " </math>\n"
1800  " </kineticLaw>\n"
1801  " </reaction>\n"
1802  " </listOfReactions>\n"
1803  " </model>\n"
1804  "</sbml>\n"
1805  ;
1806 
1807 const char* test000059::MODEL_STRING4 =
1808  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
1809  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
1810  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
1811  " <listOfFunctionDefinitions>\n"
1812  " <functionDefinition metaid=\"_000004\" id=\"reaction_2\" name=\"function_1\">\n"
1813  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1814  " <lambda>\n"
1815  " <bvar>\n"
1816  " <ci> k </ci>\n"
1817  " </bvar>\n"
1818  " <bvar>\n"
1819  " <ci> S </ci>\n"
1820  " </bvar>\n"
1821  " <apply>\n"
1822  " <times/>\n"
1823  " <ci> k </ci>\n"
1824  " <ci> S </ci>\n"
1825  " </apply>\n"
1826  " </lambda>\n"
1827  " </math>\n"
1828  " </functionDefinition>\n"
1829  " </listOfFunctionDefinitions> \n"
1830  " <listOfUnitDefinitions>\n"
1831  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
1832  " <listOfUnits>\n"
1833  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
1834  " </listOfUnits>\n"
1835  " </unitDefinition>\n"
1836  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
1837  " <listOfUnits>\n"
1838  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
1839  " </listOfUnits>\n"
1840  " </unitDefinition>\n"
1841  " </listOfUnitDefinitions> \n"
1842  " <listOfCompartments>\n"
1843  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
1844  " </compartment>\n"
1845  " </listOfCompartments>\n"
1846  " <listOfSpecies>\n"
1847  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
1848  " </listOfSpecies> \n"
1849  " <listOfParameters>\n"
1850  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
1851  " </listOfParameters>\n"
1852  " <listOfReactions>\n"
1853  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
1854  " <listOfReactants>\n"
1855  " <speciesReference species=\"species_1\"/>\n"
1856  " </listOfReactants>\n"
1857  " <kineticLaw>\n"
1858  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1859  " <apply>\n"
1860  " <times/>\n"
1861  " <ci> compartment_1 </ci>\n"
1862  " <apply>\n"
1863  " <ci> reaction_2 </ci>\n"
1864  " <ci> parameter_1 </ci>\n"
1865  " <ci> species_1 </ci>\n"
1866  " </apply>\n"
1867  " </apply>\n"
1868  " </math>\n"
1869  " </kineticLaw>\n"
1870  " </reaction>\n"
1871  " </listOfReactions>\n"
1872  " </model>\n"
1873  "</sbml>\n"
1874  ;
1875 
1876 const char* test000059::MODEL_STRING5 =
1877  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
1878  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
1879  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
1880  " <listOfFunctionDefinitions>\n"
1881  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
1882  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1883  " <lambda>\n"
1884  " <bvar>\n"
1885  " <ci> k </ci>\n"
1886  " </bvar>\n"
1887  " <bvar>\n"
1888  " <ci> S </ci>\n"
1889  " </bvar>\n"
1890  " <apply>\n"
1891  " <times/>\n"
1892  " <ci> k </ci>\n"
1893  " <ci> S </ci>\n"
1894  " </apply>\n"
1895  " </lambda>\n"
1896  " </math>\n"
1897  " </functionDefinition>\n"
1898  " </listOfFunctionDefinitions> \n"
1899  " <listOfUnitDefinitions>\n"
1900  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
1901  " <listOfUnits>\n"
1902  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
1903  " </listOfUnits>\n"
1904  " </unitDefinition>\n"
1905  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
1906  " <listOfUnits>\n"
1907  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
1908  " </listOfUnits>\n"
1909  " </unitDefinition>\n"
1910  " </listOfUnitDefinitions> \n"
1911  " <listOfCompartments>\n"
1912  " <compartment metaid=\"_000005\" id=\"species_2\" name=\"compartment_1\" size=\"1e-16\">\n"
1913  " </compartment>\n"
1914  " </listOfCompartments>\n"
1915  " <listOfSpecies>\n"
1916  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"species_2\" initialAmount=\"1.0\"/>\n"
1917  " </listOfSpecies> \n"
1918  " <listOfParameters>\n"
1919  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
1920  " </listOfParameters>\n"
1921  " <listOfReactions>\n"
1922  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
1923  " <listOfReactants>\n"
1924  " <speciesReference species=\"species_1\"/>\n"
1925  " </listOfReactants>\n"
1926  " <kineticLaw>\n"
1927  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1928  " <apply>\n"
1929  " <times/>\n"
1930  " <ci> species_2 </ci>\n"
1931  " <apply>\n"
1932  " <ci> function_1 </ci>\n"
1933  " <ci> parameter_1 </ci>\n"
1934  " <ci> species_1 </ci>\n"
1935  " </apply>\n"
1936  " </apply>\n"
1937  " </math>\n"
1938  " </kineticLaw>\n"
1939  " </reaction>\n"
1940  " </listOfReactions>\n"
1941  " </model>\n"
1942  "</sbml>\n"
1943  ;
1944 
1945 const char* test000059::MODEL_STRING6 =
1946  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
1947  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
1948  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
1949  " <listOfFunctionDefinitions>\n"
1950  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
1951  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1952  " <lambda>\n"
1953  " <bvar>\n"
1954  " <ci> k </ci>\n"
1955  " </bvar>\n"
1956  " <bvar>\n"
1957  " <ci> S </ci>\n"
1958  " </bvar>\n"
1959  " <apply>\n"
1960  " <times/>\n"
1961  " <ci> k </ci>\n"
1962  " <ci> S </ci>\n"
1963  " </apply>\n"
1964  " </lambda>\n"
1965  " </math>\n"
1966  " </functionDefinition>\n"
1967  " </listOfFunctionDefinitions> \n"
1968  " <listOfUnitDefinitions>\n"
1969  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
1970  " <listOfUnits>\n"
1971  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
1972  " </listOfUnits>\n"
1973  " </unitDefinition>\n"
1974  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
1975  " <listOfUnits>\n"
1976  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
1977  " </listOfUnits>\n"
1978  " </unitDefinition>\n"
1979  " </listOfUnitDefinitions> \n"
1980  " <listOfCompartments>\n"
1981  " <compartment metaid=\"_000005\" id=\"parameter_2\" name=\"compartment_1\" size=\"1e-16\">\n"
1982  " </compartment>\n"
1983  " </listOfCompartments>\n"
1984  " <listOfSpecies>\n"
1985  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"parameter_2\" initialAmount=\"1.0\"/>\n"
1986  " </listOfSpecies> \n"
1987  " <listOfParameters>\n"
1988  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
1989  " </listOfParameters>\n"
1990  " <listOfReactions>\n"
1991  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
1992  " <listOfReactants>\n"
1993  " <speciesReference species=\"species_1\"/>\n"
1994  " </listOfReactants>\n"
1995  " <kineticLaw>\n"
1996  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
1997  " <apply>\n"
1998  " <times/>\n"
1999  " <ci> parameter_2 </ci>\n"
2000  " <apply>\n"
2001  " <ci> function_1 </ci>\n"
2002  " <ci> parameter_1 </ci>\n"
2003  " <ci> species_1 </ci>\n"
2004  " </apply>\n"
2005  " </apply>\n"
2006  " </math>\n"
2007  " </kineticLaw>\n"
2008  " </reaction>\n"
2009  " </listOfReactions>\n"
2010  " </model>\n"
2011  "</sbml>\n"
2012  ;
2013 
2014 const char* test000059::MODEL_STRING7 =
2015  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2016  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
2017  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
2018  " <listOfFunctionDefinitions>\n"
2019  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
2020  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2021  " <lambda>\n"
2022  " <bvar>\n"
2023  " <ci> k </ci>\n"
2024  " </bvar>\n"
2025  " <bvar>\n"
2026  " <ci> S </ci>\n"
2027  " </bvar>\n"
2028  " <apply>\n"
2029  " <times/>\n"
2030  " <ci> k </ci>\n"
2031  " <ci> S </ci>\n"
2032  " </apply>\n"
2033  " </lambda>\n"
2034  " </math>\n"
2035  " </functionDefinition>\n"
2036  " </listOfFunctionDefinitions> \n"
2037  " <listOfUnitDefinitions>\n"
2038  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
2039  " <listOfUnits>\n"
2040  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
2041  " </listOfUnits>\n"
2042  " </unitDefinition>\n"
2043  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
2044  " <listOfUnits>\n"
2045  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
2046  " </listOfUnits>\n"
2047  " </unitDefinition>\n"
2048  " </listOfUnitDefinitions> \n"
2049  " <listOfCompartments>\n"
2050  " <compartment metaid=\"_000005\" id=\"reaction_2\" name=\"compartment_1\" size=\"1e-16\">\n"
2051  " </compartment>\n"
2052  " </listOfCompartments>\n"
2053  " <listOfSpecies>\n"
2054  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"reaction_2\" initialAmount=\"1.0\"/>\n"
2055  " </listOfSpecies> \n"
2056  " <listOfParameters>\n"
2057  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
2058  " </listOfParameters>\n"
2059  " <listOfReactions>\n"
2060  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
2061  " <listOfReactants>\n"
2062  " <speciesReference species=\"species_1\"/>\n"
2063  " </listOfReactants>\n"
2064  " <kineticLaw>\n"
2065  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2066  " <apply>\n"
2067  " <times/>\n"
2068  " <ci> reaction_2 </ci>\n"
2069  " <apply>\n"
2070  " <ci> function_1 </ci>\n"
2071  " <ci> parameter_1 </ci>\n"
2072  " <ci> species_1 </ci>\n"
2073  " </apply>\n"
2074  " </apply>\n"
2075  " </math>\n"
2076  " </kineticLaw>\n"
2077  " </reaction>\n"
2078  " </listOfReactions>\n"
2079  " </model>\n"
2080  "</sbml>\n"
2081  ;
2082 
2083 const char* test000059::MODEL_STRING8 =
2084  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2085  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
2086  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
2087  " <listOfFunctionDefinitions>\n"
2088  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
2089  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2090  " <lambda>\n"
2091  " <bvar>\n"
2092  " <ci> k </ci>\n"
2093  " </bvar>\n"
2094  " <bvar>\n"
2095  " <ci> S </ci>\n"
2096  " </bvar>\n"
2097  " <apply>\n"
2098  " <times/>\n"
2099  " <ci> k </ci>\n"
2100  " <ci> S </ci>\n"
2101  " </apply>\n"
2102  " </lambda>\n"
2103  " </math>\n"
2104  " </functionDefinition>\n"
2105  " </listOfFunctionDefinitions> \n"
2106  " <listOfUnitDefinitions>\n"
2107  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
2108  " <listOfUnits>\n"
2109  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
2110  " </listOfUnits>\n"
2111  " </unitDefinition>\n"
2112  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
2113  " <listOfUnits>\n"
2114  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
2115  " </listOfUnits>\n"
2116  " </unitDefinition>\n"
2117  " </listOfUnitDefinitions> \n"
2118  " <listOfCompartments>\n"
2119  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
2120  " </compartment>\n"
2121  " </listOfCompartments>\n"
2122  " <listOfSpecies>\n"
2123  " <species metaid=\"_000006\" id=\"parameter_2\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
2124  " </listOfSpecies> \n"
2125  " <listOfParameters>\n"
2126  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
2127  " </listOfParameters>\n"
2128  " <listOfReactions>\n"
2129  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
2130  " <listOfReactants>\n"
2131  " <speciesReference species=\"parameter_2\"/>\n"
2132  " </listOfReactants>\n"
2133  " <kineticLaw>\n"
2134  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2135  " <apply>\n"
2136  " <times/>\n"
2137  " <ci> compartment_1 </ci>\n"
2138  " <apply>\n"
2139  " <ci> function_1 </ci>\n"
2140  " <ci> parameter_1 </ci>\n"
2141  " <ci> parameter_2 </ci>\n"
2142  " </apply>\n"
2143  " </apply>\n"
2144  " </math>\n"
2145  " </kineticLaw>\n"
2146  " </reaction>\n"
2147  " </listOfReactions>\n"
2148  " </model>\n"
2149  "</sbml>\n"
2150  ;
2151 
2152 const char* test000059::MODEL_STRING9 =
2153  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2154  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
2155  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
2156  " <listOfFunctionDefinitions>\n"
2157  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
2158  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2159  " <lambda>\n"
2160  " <bvar>\n"
2161  " <ci> k </ci>\n"
2162  " </bvar>\n"
2163  " <bvar>\n"
2164  " <ci> S </ci>\n"
2165  " </bvar>\n"
2166  " <apply>\n"
2167  " <times/>\n"
2168  " <ci> k </ci>\n"
2169  " <ci> S </ci>\n"
2170  " </apply>\n"
2171  " </lambda>\n"
2172  " </math>\n"
2173  " </functionDefinition>\n"
2174  " </listOfFunctionDefinitions> \n"
2175  " <listOfUnitDefinitions>\n"
2176  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
2177  " <listOfUnits>\n"
2178  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
2179  " </listOfUnits>\n"
2180  " </unitDefinition>\n"
2181  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
2182  " <listOfUnits>\n"
2183  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
2184  " </listOfUnits>\n"
2185  " </unitDefinition>\n"
2186  " </listOfUnitDefinitions> \n"
2187  " <listOfCompartments>\n"
2188  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
2189  " </compartment>\n"
2190  " </listOfCompartments>\n"
2191  " <listOfSpecies>\n"
2192  " <species metaid=\"_000006\" id=\"reaction_2\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
2193  " </listOfSpecies> \n"
2194  " <listOfParameters>\n"
2195  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
2196  " </listOfParameters>\n"
2197  " <listOfReactions>\n"
2198  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
2199  " <listOfReactants>\n"
2200  " <speciesReference species=\"reaction_2\"/>\n"
2201  " </listOfReactants>\n"
2202  " <kineticLaw>\n"
2203  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2204  " <apply>\n"
2205  " <times/>\n"
2206  " <ci> compartment_1 </ci>\n"
2207  " <apply>\n"
2208  " <ci> function_1 </ci>\n"
2209  " <ci> parameter_1 </ci>\n"
2210  " <ci> reaction_2 </ci>\n"
2211  " </apply>\n"
2212  " </apply>\n"
2213  " </math>\n"
2214  " </kineticLaw>\n"
2215  " </reaction>\n"
2216  " </listOfReactions>\n"
2217  " </model>\n"
2218  "</sbml>\n"
2219  ;
2220 
2221 const char* test000059::MODEL_STRING10 =
2222  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2223  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
2224  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
2225  " <listOfFunctionDefinitions>\n"
2226  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
2227  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2228  " <lambda>\n"
2229  " <bvar>\n"
2230  " <ci> k </ci>\n"
2231  " </bvar>\n"
2232  " <bvar>\n"
2233  " <ci> S </ci>\n"
2234  " </bvar>\n"
2235  " <apply>\n"
2236  " <times/>\n"
2237  " <ci> k </ci>\n"
2238  " <ci> S </ci>\n"
2239  " </apply>\n"
2240  " </lambda>\n"
2241  " </math>\n"
2242  " </functionDefinition>\n"
2243  " </listOfFunctionDefinitions> \n"
2244  " <listOfUnitDefinitions>\n"
2245  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
2246  " <listOfUnits>\n"
2247  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
2248  " </listOfUnits>\n"
2249  " </unitDefinition>\n"
2250  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
2251  " <listOfUnits>\n"
2252  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
2253  " </listOfUnits>\n"
2254  " </unitDefinition>\n"
2255  " </listOfUnitDefinitions> \n"
2256  " <listOfCompartments>\n"
2257  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
2258  " </compartment>\n"
2259  " </listOfCompartments>\n"
2260  " <listOfSpecies>\n"
2261  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
2262  " </listOfSpecies> \n"
2263  " <listOfParameters>\n"
2264  " <parameter metaid=\"_000007\" id=\"reaction_2\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
2265  " </listOfParameters>\n"
2266  " <listOfReactions>\n"
2267  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
2268  " <listOfReactants>\n"
2269  " <speciesReference species=\"species_1\"/>\n"
2270  " </listOfReactants>\n"
2271  " <kineticLaw>\n"
2272  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2273  " <apply>\n"
2274  " <times/>\n"
2275  " <ci> compartment_1 </ci>\n"
2276  " <apply>\n"
2277  " <ci> function_1 </ci>\n"
2278  " <ci> reaction_2 </ci>\n"
2279  " <ci> species_1 </ci>\n"
2280  " </apply>\n"
2281  " </apply>\n"
2282  " </math>\n"
2283  " </kineticLaw>\n"
2284  " </reaction>\n"
2285  " </listOfReactions>\n"
2286  " </model>\n"
2287  "</sbml>\n"
2288  ;
2289 
2290 const char* test000059::MODEL_STRING11 =
2291  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2292  "<!-- generated with COPASI 4.3.25 (Debug) (http://www.copasi.org) at 2008-04-29 13:08:40 UTC -->\n"
2293  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"25\">\n"
2294  " <ListOfFunctions>\n"
2295  " <Function key=\"Function_40\" name=\"Function for reaction_1\" type=\"UserDefined\" reversible=\"true\">\n"
2296  " <Expression>\n"
2297  " parameter_1*species_1\n"
2298  " </Expression>\n"
2299  " <ListOfParameterDescriptions>\n"
2300  " <ParameterDescription key=\"FunctionParameter_250\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
2301  " <ParameterDescription key=\"FunctionParameter_254\" name=\"species_1\" order=\"1\" role=\"substrate\"/>\n"
2302  " </ListOfParameterDescriptions>\n"
2303  " </Function>\n"
2304  " </ListOfFunctions>\n"
2305  " <Model key=\"Model_1\" name=\"model_1\" timeUnit=\"s\" volumeUnit=\"l\" quantityUnit=\"mol\" type=\"deterministic\">\n"
2306  " <Comment>\n"
2307  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
2308  " \n"
2309  " </body>\n"
2310  " </Comment>\n"
2311  " <ListOfCompartments>\n"
2312  " <Compartment key=\"Compartment_0\" name=\"compartment_1\" simulationType=\"fixed\">\n"
2313  " </Compartment>\n"
2314  " </ListOfCompartments>\n"
2315  " <ListOfMetabolites>\n"
2316  " <Metabolite key=\"Metabolite_0\" name=\"species_1\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
2317  " </Metabolite>\n"
2318  " </ListOfMetabolites>\n"
2319  " <ListOfModelValues>\n"
2320  " <ModelValue key=\"ModelValue_0\" name=\"parameter_1\" simulationType=\"fixed\">\n"
2321  " </ModelValue>\n"
2322  " </ListOfModelValues>\n"
2323  " <ListOfReactions>\n"
2324  " <Reaction key=\"Reaction_0\" name=\"reaction_1\" reversible=\"true\">\n"
2325  " <ListOfSubstrates>\n"
2326  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
2327  " </ListOfSubstrates>\n"
2328  " <ListOfConstants>\n"
2329  " <Constant key=\"Parameter_81\" name=\"parameter_1\" value=\"1\"/>\n"
2330  " </ListOfConstants>\n"
2331  " <KineticLaw function=\"Function_40\">\n"
2332  " <ListOfCallParameters>\n"
2333  " <CallParameter functionParameter=\"FunctionParameter_250\">\n"
2334  " <SourceParameter reference=\"ModelValue_0\"/>\n"
2335  " </CallParameter>\n"
2336  " <CallParameter functionParameter=\"FunctionParameter_254\">\n"
2337  " <SourceParameter reference=\"Metabolite_0\"/>\n"
2338  " </CallParameter>\n"
2339  " </ListOfCallParameters>\n"
2340  " </KineticLaw>\n"
2341  " </Reaction>\n"
2342  " </ListOfReactions>\n"
2343  " <StateTemplate>\n"
2344  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
2345  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
2346  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
2347  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
2348  " </StateTemplate>\n"
2349  " <InitialState type=\"initialState\">\n"
2350  " 0 6.0221415e+23 3 1e-16\n"
2351  " </InitialState>\n"
2352  " </Model>\n"
2353  " <SBMLReference file=\"test000059.xml\">\n"
2354  " <SBMLMap SBMLid=\"species_2\" COPASIkey=\"Compartment_0\"/>\n"
2355  " <SBMLMap SBMLid=\"parameter_1\" COPASIkey=\"ModelValue_0\"/>\n"
2356  " <SBMLMap SBMLid=\"reaction_1\" COPASIkey=\"Reaction_0\"/>\n"
2357  " <SBMLMap SBMLid=\"species_1\" COPASIkey=\"Metabolite_0\"/>\n"
2358  " </SBMLReference>\n"
2359  "</COPASI>\n"
2360  ;
2361 
2362 const char* test000059::MODEL_STRING12 =
2363  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2364  "<!-- generated with COPASI 4.3.25 (Debug) (http://www.copasi.org) at 2008-04-29 13:08:40 UTC -->\n"
2365  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"25\">\n"
2366  " <ListOfFunctions>\n"
2367  " <Function key=\"Function_40\" name=\"Function for reaction_1\" type=\"UserDefined\" reversible=\"true\">\n"
2368  " <Expression>\n"
2369  " parameter_1*species_1\n"
2370  " </Expression>\n"
2371  " <ListOfParameterDescriptions>\n"
2372  " <ParameterDescription key=\"FunctionParameter_250\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
2373  " <ParameterDescription key=\"FunctionParameter_254\" name=\"species_1\" order=\"1\" role=\"substrate\"/>\n"
2374  " </ListOfParameterDescriptions>\n"
2375  " </Function>\n"
2376  " </ListOfFunctions>\n"
2377  " <Model key=\"Model_1\" name=\"model_1\" timeUnit=\"s\" volumeUnit=\"l\" quantityUnit=\"mol\" type=\"deterministic\">\n"
2378  " <Comment>\n"
2379  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
2380  " \n"
2381  " </body>\n"
2382  " </Comment>\n"
2383  " <ListOfCompartments>\n"
2384  " <Compartment key=\"Compartment_0\" name=\"compartment_1\" simulationType=\"fixed\">\n"
2385  " </Compartment>\n"
2386  " </ListOfCompartments>\n"
2387  " <ListOfMetabolites>\n"
2388  " <Metabolite key=\"Metabolite_0\" name=\"species_1\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
2389  " </Metabolite>\n"
2390  " </ListOfMetabolites>\n"
2391  " <ListOfModelValues>\n"
2392  " <ModelValue key=\"ModelValue_0\" name=\"parameter_1\" simulationType=\"fixed\">\n"
2393  " </ModelValue>\n"
2394  " </ListOfModelValues>\n"
2395  " <ListOfReactions>\n"
2396  " <Reaction key=\"Reaction_0\" name=\"reaction_1\" reversible=\"true\">\n"
2397  " <ListOfSubstrates>\n"
2398  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
2399  " </ListOfSubstrates>\n"
2400  " <ListOfConstants>\n"
2401  " <Constant key=\"Parameter_81\" name=\"parameter_1\" value=\"1\"/>\n"
2402  " </ListOfConstants>\n"
2403  " <KineticLaw function=\"Function_40\">\n"
2404  " <ListOfCallParameters>\n"
2405  " <CallParameter functionParameter=\"FunctionParameter_250\">\n"
2406  " <SourceParameter reference=\"ModelValue_0\"/>\n"
2407  " </CallParameter>\n"
2408  " <CallParameter functionParameter=\"FunctionParameter_254\">\n"
2409  " <SourceParameter reference=\"Metabolite_0\"/>\n"
2410  " </CallParameter>\n"
2411  " </ListOfCallParameters>\n"
2412  " </KineticLaw>\n"
2413  " </Reaction>\n"
2414  " </ListOfReactions>\n"
2415  " <StateTemplate>\n"
2416  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
2417  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
2418  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
2419  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
2420  " </StateTemplate>\n"
2421  " <InitialState type=\"initialState\">\n"
2422  " 0 6.0221415e+23 3 1e-16\n"
2423  " </InitialState>\n"
2424  " </Model>\n"
2425  " <SBMLReference file=\"test000059.xml\">\n"
2426  " <SBMLMap SBMLid=\"parameter_2\" COPASIkey=\"Compartment_0\"/>\n"
2427  " <SBMLMap SBMLid=\"parameter_1\" COPASIkey=\"ModelValue_0\"/>\n"
2428  " <SBMLMap SBMLid=\"reaction_1\" COPASIkey=\"Reaction_0\"/>\n"
2429  " <SBMLMap SBMLid=\"species_1\" COPASIkey=\"Metabolite_0\"/>\n"
2430  " </SBMLReference>\n"
2431  "</COPASI>\n"
2432  ;
2433 
2434 const char* test000059::MODEL_STRING13 =
2435  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2436  "<!-- generated with COPASI 4.3.25 (Debug) (http://www.copasi.org) at 2008-04-29 13:08:40 UTC -->\n"
2437  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"25\">\n"
2438  " <ListOfFunctions>\n"
2439  " <Function key=\"Function_40\" name=\"Function for reaction_1\" type=\"UserDefined\" reversible=\"true\">\n"
2440  " <Expression>\n"
2441  " parameter_1*species_1\n"
2442  " </Expression>\n"
2443  " <ListOfParameterDescriptions>\n"
2444  " <ParameterDescription key=\"FunctionParameter_250\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
2445  " <ParameterDescription key=\"FunctionParameter_254\" name=\"species_1\" order=\"1\" role=\"substrate\"/>\n"
2446  " </ListOfParameterDescriptions>\n"
2447  " </Function>\n"
2448  " </ListOfFunctions>\n"
2449  " <Model key=\"Model_1\" name=\"model_1\" timeUnit=\"s\" volumeUnit=\"l\" quantityUnit=\"mol\" type=\"deterministic\">\n"
2450  " <Comment>\n"
2451  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
2452  " \n"
2453  " </body>\n"
2454  " </Comment>\n"
2455  " <ListOfCompartments>\n"
2456  " <Compartment key=\"Compartment_0\" name=\"compartment_1\" simulationType=\"fixed\">\n"
2457  " </Compartment>\n"
2458  " </ListOfCompartments>\n"
2459  " <ListOfMetabolites>\n"
2460  " <Metabolite key=\"Metabolite_0\" name=\"species_1\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
2461  " </Metabolite>\n"
2462  " </ListOfMetabolites>\n"
2463  " <ListOfModelValues>\n"
2464  " <ModelValue key=\"ModelValue_0\" name=\"parameter_1\" simulationType=\"fixed\">\n"
2465  " </ModelValue>\n"
2466  " </ListOfModelValues>\n"
2467  " <ListOfReactions>\n"
2468  " <Reaction key=\"Reaction_0\" name=\"reaction_1\" reversible=\"true\">\n"
2469  " <ListOfSubstrates>\n"
2470  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
2471  " </ListOfSubstrates>\n"
2472  " <ListOfConstants>\n"
2473  " <Constant key=\"Parameter_81\" name=\"parameter_1\" value=\"1\"/>\n"
2474  " </ListOfConstants>\n"
2475  " <KineticLaw function=\"Function_40\">\n"
2476  " <ListOfCallParameters>\n"
2477  " <CallParameter functionParameter=\"FunctionParameter_250\">\n"
2478  " <SourceParameter reference=\"ModelValue_0\"/>\n"
2479  " </CallParameter>\n"
2480  " <CallParameter functionParameter=\"FunctionParameter_254\">\n"
2481  " <SourceParameter reference=\"Metabolite_0\"/>\n"
2482  " </CallParameter>\n"
2483  " </ListOfCallParameters>\n"
2484  " </KineticLaw>\n"
2485  " </Reaction>\n"
2486  " </ListOfReactions>\n"
2487  " <StateTemplate>\n"
2488  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
2489  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
2490  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
2491  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
2492  " </StateTemplate>\n"
2493  " <InitialState type=\"initialState\">\n"
2494  " 0 6.0221415e+23 3 1e-16\n"
2495  " </InitialState>\n"
2496  " </Model>\n"
2497  " <SBMLReference file=\"test000059.xml\">\n"
2498  " <SBMLMap SBMLid=\"reaction_2\" COPASIkey=\"Compartment_0\"/>\n"
2499  " <SBMLMap SBMLid=\"parameter_1\" COPASIkey=\"ModelValue_0\"/>\n"
2500  " <SBMLMap SBMLid=\"reaction_1\" COPASIkey=\"Reaction_0\"/>\n"
2501  " <SBMLMap SBMLid=\"species_1\" COPASIkey=\"Metabolite_0\"/>\n"
2502  " </SBMLReference>\n"
2503  "</COPASI>\n"
2504  ;
2505 
2506 const char* test000059::MODEL_STRING14 =
2507  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2508  "<!-- generated with COPASI 4.3.25 (Debug) (http://www.copasi.org) at 2008-04-29 13:08:40 UTC -->\n"
2509  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"25\">\n"
2510  " <ListOfFunctions>\n"
2511  " <Function key=\"Function_40\" name=\"Function for reaction_1\" type=\"UserDefined\" reversible=\"true\">\n"
2512  " <Expression>\n"
2513  " parameter_1*species_1\n"
2514  " </Expression>\n"
2515  " <ListOfParameterDescriptions>\n"
2516  " <ParameterDescription key=\"FunctionParameter_250\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
2517  " <ParameterDescription key=\"FunctionParameter_254\" name=\"species_1\" order=\"1\" role=\"substrate\"/>\n"
2518  " </ListOfParameterDescriptions>\n"
2519  " </Function>\n"
2520  " </ListOfFunctions>\n"
2521  " <Model key=\"Model_1\" name=\"model_1\" timeUnit=\"s\" volumeUnit=\"l\" quantityUnit=\"mol\" type=\"deterministic\">\n"
2522  " <Comment>\n"
2523  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
2524  " \n"
2525  " </body>\n"
2526  " </Comment>\n"
2527  " <ListOfCompartments>\n"
2528  " <Compartment key=\"Compartment_0\" name=\"compartment_1\" simulationType=\"fixed\">\n"
2529  " </Compartment>\n"
2530  " </ListOfCompartments>\n"
2531  " <ListOfMetabolites>\n"
2532  " <Metabolite key=\"Metabolite_0\" name=\"species_1\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
2533  " </Metabolite>\n"
2534  " </ListOfMetabolites>\n"
2535  " <ListOfModelValues>\n"
2536  " <ModelValue key=\"ModelValue_0\" name=\"parameter_1\" simulationType=\"fixed\">\n"
2537  " </ModelValue>\n"
2538  " </ListOfModelValues>\n"
2539  " <ListOfReactions>\n"
2540  " <Reaction key=\"Reaction_0\" name=\"reaction_1\" reversible=\"true\">\n"
2541  " <ListOfSubstrates>\n"
2542  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
2543  " </ListOfSubstrates>\n"
2544  " <ListOfConstants>\n"
2545  " <Constant key=\"Parameter_81\" name=\"parameter_1\" value=\"1\"/>\n"
2546  " </ListOfConstants>\n"
2547  " <KineticLaw function=\"Function_40\">\n"
2548  " <ListOfCallParameters>\n"
2549  " <CallParameter functionParameter=\"FunctionParameter_250\">\n"
2550  " <SourceParameter reference=\"ModelValue_0\"/>\n"
2551  " </CallParameter>\n"
2552  " <CallParameter functionParameter=\"FunctionParameter_254\">\n"
2553  " <SourceParameter reference=\"Metabolite_0\"/>\n"
2554  " </CallParameter>\n"
2555  " </ListOfCallParameters>\n"
2556  " </KineticLaw>\n"
2557  " </Reaction>\n"
2558  " </ListOfReactions>\n"
2559  " <StateTemplate>\n"
2560  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
2561  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
2562  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
2563  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
2564  " </StateTemplate>\n"
2565  " <InitialState type=\"initialState\">\n"
2566  " 0 6.0221415e+23 3 1e-16\n"
2567  " </InitialState>\n"
2568  " </Model>\n"
2569  " <SBMLReference file=\"test000059.xml\">\n"
2570  " <SBMLMap SBMLid=\"compartment_1\" COPASIkey=\"Compartment_0\"/>\n"
2571  " <SBMLMap SBMLid=\"parameter_1\" COPASIkey=\"ModelValue_0\"/>\n"
2572  " <SBMLMap SBMLid=\"reaction_1\" COPASIkey=\"Reaction_0\"/>\n"
2573  " <SBMLMap SBMLid=\"parameter_2\" COPASIkey=\"Metabolite_0\"/>\n"
2574  " </SBMLReference>\n"
2575  "</COPASI>\n"
2576  ;
2577 
2578 const char* test000059::MODEL_STRING15 =
2579  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2580  "<!-- generated with COPASI 4.3.25 (Debug) (http://www.copasi.org) at 2008-04-29 13:08:40 UTC -->\n"
2581  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"25\">\n"
2582  " <ListOfFunctions>\n"
2583  " <Function key=\"Function_40\" name=\"Function for reaction_1\" type=\"UserDefined\" reversible=\"true\">\n"
2584  " <Expression>\n"
2585  " parameter_1*species_1\n"
2586  " </Expression>\n"
2587  " <ListOfParameterDescriptions>\n"
2588  " <ParameterDescription key=\"FunctionParameter_250\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
2589  " <ParameterDescription key=\"FunctionParameter_254\" name=\"species_1\" order=\"1\" role=\"substrate\"/>\n"
2590  " </ListOfParameterDescriptions>\n"
2591  " </Function>\n"
2592  " </ListOfFunctions>\n"
2593  " <Model key=\"Model_1\" name=\"model_1\" timeUnit=\"s\" volumeUnit=\"l\" quantityUnit=\"mol\" type=\"deterministic\">\n"
2594  " <Comment>\n"
2595  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
2596  " \n"
2597  " </body>\n"
2598  " </Comment>\n"
2599  " <ListOfCompartments>\n"
2600  " <Compartment key=\"Compartment_0\" name=\"compartment_1\" simulationType=\"fixed\">\n"
2601  " </Compartment>\n"
2602  " </ListOfCompartments>\n"
2603  " <ListOfMetabolites>\n"
2604  " <Metabolite key=\"Metabolite_0\" name=\"species_1\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
2605  " </Metabolite>\n"
2606  " </ListOfMetabolites>\n"
2607  " <ListOfModelValues>\n"
2608  " <ModelValue key=\"ModelValue_0\" name=\"parameter_1\" simulationType=\"fixed\">\n"
2609  " </ModelValue>\n"
2610  " </ListOfModelValues>\n"
2611  " <ListOfReactions>\n"
2612  " <Reaction key=\"Reaction_0\" name=\"reaction_1\" reversible=\"true\">\n"
2613  " <ListOfSubstrates>\n"
2614  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
2615  " </ListOfSubstrates>\n"
2616  " <ListOfConstants>\n"
2617  " <Constant key=\"Parameter_81\" name=\"parameter_1\" value=\"1\"/>\n"
2618  " </ListOfConstants>\n"
2619  " <KineticLaw function=\"Function_40\">\n"
2620  " <ListOfCallParameters>\n"
2621  " <CallParameter functionParameter=\"FunctionParameter_250\">\n"
2622  " <SourceParameter reference=\"ModelValue_0\"/>\n"
2623  " </CallParameter>\n"
2624  " <CallParameter functionParameter=\"FunctionParameter_254\">\n"
2625  " <SourceParameter reference=\"Metabolite_0\"/>\n"
2626  " </CallParameter>\n"
2627  " </ListOfCallParameters>\n"
2628  " </KineticLaw>\n"
2629  " </Reaction>\n"
2630  " </ListOfReactions>\n"
2631  " <StateTemplate>\n"
2632  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
2633  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
2634  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
2635  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
2636  " </StateTemplate>\n"
2637  " <InitialState type=\"initialState\">\n"
2638  " 0 6.0221415e+23 3 1e-16\n"
2639  " </InitialState>\n"
2640  " </Model>\n"
2641  " <SBMLReference file=\"test000059.xml\">\n"
2642  " <SBMLMap SBMLid=\"compartment_1\" COPASIkey=\"Compartment_0\"/>\n"
2643  " <SBMLMap SBMLid=\"parameter_1\" COPASIkey=\"ModelValue_0\"/>\n"
2644  " <SBMLMap SBMLid=\"reaction_1\" COPASIkey=\"Reaction_0\"/>\n"
2645  " <SBMLMap SBMLid=\"reaction_2\" COPASIkey=\"Metabolite_0\"/>\n"
2646  " </SBMLReference>\n"
2647  "</COPASI>\n"
2648  ;
2649 
2650 const char* test000059::MODEL_STRING16 =
2651  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2652  "<!-- generated with COPASI 4.3.25 (Debug) (http://www.copasi.org) at 2008-04-29 13:08:40 UTC -->\n"
2653  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"25\">\n"
2654  " <ListOfFunctions>\n"
2655  " <Function key=\"Function_40\" name=\"Function for reaction_1\" type=\"UserDefined\" reversible=\"true\">\n"
2656  " <Expression>\n"
2657  " parameter_1*species_1\n"
2658  " </Expression>\n"
2659  " <ListOfParameterDescriptions>\n"
2660  " <ParameterDescription key=\"FunctionParameter_250\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
2661  " <ParameterDescription key=\"FunctionParameter_254\" name=\"species_1\" order=\"1\" role=\"substrate\"/>\n"
2662  " </ListOfParameterDescriptions>\n"
2663  " </Function>\n"
2664  " </ListOfFunctions>\n"
2665  " <Model key=\"Model_1\" name=\"model_1\" timeUnit=\"s\" volumeUnit=\"l\" quantityUnit=\"mol\" type=\"deterministic\">\n"
2666  " <Comment>\n"
2667  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
2668  " \n"
2669  " </body>\n"
2670  " </Comment>\n"
2671  " <ListOfCompartments>\n"
2672  " <Compartment key=\"Compartment_0\" name=\"compartment_1\" simulationType=\"fixed\">\n"
2673  " </Compartment>\n"
2674  " </ListOfCompartments>\n"
2675  " <ListOfMetabolites>\n"
2676  " <Metabolite key=\"Metabolite_0\" name=\"species_1\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
2677  " </Metabolite>\n"
2678  " </ListOfMetabolites>\n"
2679  " <ListOfModelValues>\n"
2680  " <ModelValue key=\"ModelValue_0\" name=\"parameter_1\" simulationType=\"fixed\">\n"
2681  " </ModelValue>\n"
2682  " </ListOfModelValues>\n"
2683  " <ListOfReactions>\n"
2684  " <Reaction key=\"Reaction_0\" name=\"reaction_1\" reversible=\"true\">\n"
2685  " <ListOfSubstrates>\n"
2686  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
2687  " </ListOfSubstrates>\n"
2688  " <ListOfConstants>\n"
2689  " <Constant key=\"Parameter_81\" name=\"parameter_1\" value=\"1\"/>\n"
2690  " </ListOfConstants>\n"
2691  " <KineticLaw function=\"Function_40\">\n"
2692  " <ListOfCallParameters>\n"
2693  " <CallParameter functionParameter=\"FunctionParameter_250\">\n"
2694  " <SourceParameter reference=\"ModelValue_0\"/>\n"
2695  " </CallParameter>\n"
2696  " <CallParameter functionParameter=\"FunctionParameter_254\">\n"
2697  " <SourceParameter reference=\"Metabolite_0\"/>\n"
2698  " </CallParameter>\n"
2699  " </ListOfCallParameters>\n"
2700  " </KineticLaw>\n"
2701  " </Reaction>\n"
2702  " </ListOfReactions>\n"
2703  " <StateTemplate>\n"
2704  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
2705  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
2706  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
2707  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
2708  " </StateTemplate>\n"
2709  " <InitialState type=\"initialState\">\n"
2710  " 0 6.0221415e+23 3 1e-16\n"
2711  " </InitialState>\n"
2712  " </Model>\n"
2713  " <SBMLReference file=\"test000059.xml\">\n"
2714  " <SBMLMap SBMLid=\"compartment_1\" COPASIkey=\"Compartment_0\"/>\n"
2715  " <SBMLMap SBMLid=\"reaction_2\" COPASIkey=\"ModelValue_0\"/>\n"
2716  " <SBMLMap SBMLid=\"reaction_1\" COPASIkey=\"Reaction_0\"/>\n"
2717  " <SBMLMap SBMLid=\"species_1\" COPASIkey=\"Metabolite_0\"/>\n"
2718  " </SBMLReference>\n"
2719  "</COPASI>\n"
2720  ;
2721 
2722 const char* test000059::MODEL_STRING17 =
2723  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2724  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
2725  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
2726  " <listOfFunctionDefinitions>\n"
2727  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
2728  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2729  " <lambda>\n"
2730  " <bvar>\n"
2731  " <ci> k </ci>\n"
2732  " </bvar>\n"
2733  " <bvar>\n"
2734  " <ci> S </ci>\n"
2735  " </bvar>\n"
2736  " <apply>\n"
2737  " <times/>\n"
2738  " <ci> k </ci>\n"
2739  " <ci> S </ci>\n"
2740  " </apply>\n"
2741  " </lambda>\n"
2742  " </math>\n"
2743  " </functionDefinition>\n"
2744  " </listOfFunctionDefinitions> \n"
2745  " <listOfUnitDefinitions>\n"
2746  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
2747  " <listOfUnits>\n"
2748  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
2749  " </listOfUnits>\n"
2750  " </unitDefinition>\n"
2751  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
2752  " <listOfUnits>\n"
2753  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
2754  " </listOfUnits>\n"
2755  " </unitDefinition>\n"
2756  " </listOfUnitDefinitions> \n"
2757  " <listOfCompartments>\n"
2758  " <compartment metaid=\"_000005\" id=\"function_2\" name=\"compartment_1\" size=\"1e-16\">\n"
2759  " </compartment>\n"
2760  " </listOfCompartments>\n"
2761  " <listOfSpecies>\n"
2762  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"function_2\" initialAmount=\"1.0\"/>\n"
2763  " </listOfSpecies> \n"
2764  " <listOfParameters>\n"
2765  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
2766  " </listOfParameters>\n"
2767  " <listOfReactions>\n"
2768  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
2769  " <listOfReactants>\n"
2770  " <speciesReference species=\"species_1\"/>\n"
2771  " </listOfReactants>\n"
2772  " <kineticLaw>\n"
2773  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2774  " <apply>\n"
2775  " <times/>\n"
2776  " <ci> function_2 </ci>\n"
2777  " <apply>\n"
2778  " <ci> function_1 </ci>\n"
2779  " <ci> parameter_1 </ci>\n"
2780  " <ci> species_1 </ci>\n"
2781  " </apply>\n"
2782  " </apply>\n"
2783  " </math>\n"
2784  " </kineticLaw>\n"
2785  " </reaction>\n"
2786  " </listOfReactions>\n"
2787  " </model>\n"
2788  "</sbml>\n"
2789  ;
2790 
2791 const char* test000059::MODEL_STRING18 =
2792  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2793  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
2794  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
2795  " <listOfFunctionDefinitions>\n"
2796  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
2797  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2798  " <lambda>\n"
2799  " <bvar>\n"
2800  " <ci> k </ci>\n"
2801  " </bvar>\n"
2802  " <bvar>\n"
2803  " <ci> S </ci>\n"
2804  " </bvar>\n"
2805  " <apply>\n"
2806  " <times/>\n"
2807  " <ci> k </ci>\n"
2808  " <ci> S </ci>\n"
2809  " </apply>\n"
2810  " </lambda>\n"
2811  " </math>\n"
2812  " </functionDefinition>\n"
2813  " </listOfFunctionDefinitions> \n"
2814  " <listOfUnitDefinitions>\n"
2815  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
2816  " <listOfUnits>\n"
2817  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
2818  " </listOfUnits>\n"
2819  " </unitDefinition>\n"
2820  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
2821  " <listOfUnits>\n"
2822  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
2823  " </listOfUnits>\n"
2824  " </unitDefinition>\n"
2825  " </listOfUnitDefinitions> \n"
2826  " <listOfCompartments>\n"
2827  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
2828  " </compartment>\n"
2829  " </listOfCompartments>\n"
2830  " <listOfSpecies>\n"
2831  " <species metaid=\"_000006\" id=\"function_2\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
2832  " </listOfSpecies> \n"
2833  " <listOfParameters>\n"
2834  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
2835  " </listOfParameters>\n"
2836  " <listOfReactions>\n"
2837  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
2838  " <listOfReactants>\n"
2839  " <speciesReference species=\"function_2\"/>\n"
2840  " </listOfReactants>\n"
2841  " <kineticLaw>\n"
2842  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2843  " <apply>\n"
2844  " <times/>\n"
2845  " <ci> compartment_1 </ci>\n"
2846  " <apply>\n"
2847  " <ci> function_1 </ci>\n"
2848  " <ci> parameter_1 </ci>\n"
2849  " <ci> function_2 </ci>\n"
2850  " </apply>\n"
2851  " </apply>\n"
2852  " </math>\n"
2853  " </kineticLaw>\n"
2854  " </reaction>\n"
2855  " </listOfReactions>\n"
2856  " </model>\n"
2857  "</sbml>\n"
2858  ;
2859 
2860 const char* test000059::MODEL_STRING19 =
2861  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2862  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
2863  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
2864  " <listOfFunctionDefinitions>\n"
2865  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
2866  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2867  " <lambda>\n"
2868  " <bvar>\n"
2869  " <ci> k </ci>\n"
2870  " </bvar>\n"
2871  " <bvar>\n"
2872  " <ci> S </ci>\n"
2873  " </bvar>\n"
2874  " <apply>\n"
2875  " <times/>\n"
2876  " <ci> k </ci>\n"
2877  " <ci> S </ci>\n"
2878  " </apply>\n"
2879  " </lambda>\n"
2880  " </math>\n"
2881  " </functionDefinition>\n"
2882  " </listOfFunctionDefinitions> \n"
2883  " <listOfUnitDefinitions>\n"
2884  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
2885  " <listOfUnits>\n"
2886  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
2887  " </listOfUnits>\n"
2888  " </unitDefinition>\n"
2889  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
2890  " <listOfUnits>\n"
2891  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
2892  " </listOfUnits>\n"
2893  " </unitDefinition>\n"
2894  " </listOfUnitDefinitions> \n"
2895  " <listOfCompartments>\n"
2896  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
2897  " </compartment>\n"
2898  " </listOfCompartments>\n"
2899  " <listOfSpecies>\n"
2900  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
2901  " </listOfSpecies> \n"
2902  " <listOfParameters>\n"
2903  " <parameter metaid=\"_000007\" id=\"function_2\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
2904  " </listOfParameters>\n"
2905  " <listOfReactions>\n"
2906  " <reaction metaid=\"_000008\" id=\"reaction_1\" name=\"reaction_1\">\n"
2907  " <listOfReactants>\n"
2908  " <speciesReference species=\"species_1\"/>\n"
2909  " </listOfReactants>\n"
2910  " <kineticLaw>\n"
2911  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2912  " <apply>\n"
2913  " <times/>\n"
2914  " <ci> compartment_1 </ci>\n"
2915  " <apply>\n"
2916  " <ci> function_1 </ci>\n"
2917  " <ci> function_2 </ci>\n"
2918  " <ci> species_1 </ci>\n"
2919  " </apply>\n"
2920  " </apply>\n"
2921  " </math>\n"
2922  " </kineticLaw>\n"
2923  " </reaction>\n"
2924  " </listOfReactions>\n"
2925  " </model>\n"
2926  "</sbml>\n"
2927  ;
2928 
2929 const char* test000059::MODEL_STRING20 =
2930  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
2931  "<sbml xmlns=\"http://www.sbml.org/sbml/level2\" metaid=\"_000000\" level=\"2\" version=\"1\">\n"
2932  " <model metaid=\"_000001\" id=\"model_1\" name=\"model_1\">\n"
2933  " <listOfFunctionDefinitions>\n"
2934  " <functionDefinition metaid=\"_000004\" id=\"function_1\" name=\"function_1\">\n"
2935  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2936  " <lambda>\n"
2937  " <bvar>\n"
2938  " <ci> k </ci>\n"
2939  " </bvar>\n"
2940  " <bvar>\n"
2941  " <ci> S </ci>\n"
2942  " </bvar>\n"
2943  " <apply>\n"
2944  " <times/>\n"
2945  " <ci> k </ci>\n"
2946  " <ci> S </ci>\n"
2947  " </apply>\n"
2948  " </lambda>\n"
2949  " </math>\n"
2950  " </functionDefinition>\n"
2951  " </listOfFunctionDefinitions> \n"
2952  " <listOfUnitDefinitions>\n"
2953  " <unitDefinition metaid=\"_000002\" id=\"time\" name=\"time\">\n"
2954  " <listOfUnits>\n"
2955  " <unit kind=\"second\" scale=\"0\" multiplier=\"1\"/>\n"
2956  " </listOfUnits>\n"
2957  " </unitDefinition>\n"
2958  " <unitDefinition metaid=\"_000003\" id=\"unit_2\" name=\"unit_2\">\n"
2959  " <listOfUnits>\n"
2960  " <unit kind=\"second\" exponent=\"-1\" scale=\"0\" multiplier=\"1\"/>\n"
2961  " </listOfUnits>\n"
2962  " </unitDefinition>\n"
2963  " </listOfUnitDefinitions> \n"
2964  " <listOfCompartments>\n"
2965  " <compartment metaid=\"_000005\" id=\"compartment_1\" name=\"compartment_1\" size=\"1e-16\">\n"
2966  " </compartment>\n"
2967  " </listOfCompartments>\n"
2968  " <listOfSpecies>\n"
2969  " <species metaid=\"_000006\" id=\"species_1\" name=\"species_1\" compartment=\"compartment_1\" initialAmount=\"1.0\"/>\n"
2970  " </listOfSpecies> \n"
2971  " <listOfParameters>\n"
2972  " <parameter metaid=\"_000007\" id=\"parameter_1\" name=\"parameter_1\" value=\"3.0\" constant=\"false\" units=\"unit_2\"/>\n"
2973  " </listOfParameters>\n"
2974  " <listOfReactions>\n"
2975  " <reaction metaid=\"_000008\" id=\"function_2\" name=\"reaction_1\">\n"
2976  " <listOfReactants>\n"
2977  " <speciesReference species=\"species_1\"/>\n"
2978  " </listOfReactants>\n"
2979  " <kineticLaw>\n"
2980  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n"
2981  " <apply>\n"
2982  " <times/>\n"
2983  " <ci> compartment_1 </ci>\n"
2984  " <apply>\n"
2985  " <ci> function_1 </ci>\n"
2986  " <ci> parameter_1 </ci>\n"
2987  " <ci> species_1 </ci>\n"
2988  " </apply>\n"
2989  " </apply>\n"
2990  " </math>\n"
2991  " </kineticLaw>\n"
2992  " </reaction>\n"
2993  " </listOfReactions>\n"
2994  " </model>\n"
2995  "</sbml>\n"
2996  ;
2997 
2998 const char* test000059::MODEL_STRING21 =
2999  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
3000  "<!-- generated with COPASI 4.3.25 (Debug) (http://www.copasi.org) at 2008-04-29 13:08:40 UTC -->\n"
3001  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"25\">\n"
3002  " <ListOfFunctions>\n"
3003  " <Function key=\"Function_40\" name=\"Function for reaction_1\" type=\"UserDefined\" reversible=\"true\">\n"
3004  " <Expression>\n"
3005  " parameter_1*species_1\n"
3006  " </Expression>\n"
3007  " <ListOfParameterDescriptions>\n"
3008  " <ParameterDescription key=\"FunctionParameter_250\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
3009  " <ParameterDescription key=\"FunctionParameter_254\" name=\"species_1\" order=\"1\" role=\"substrate\"/>\n"
3010  " </ListOfParameterDescriptions>\n"
3011  " </Function>\n"
3012  " </ListOfFunctions>\n"
3013  " <Model key=\"Model_1\" name=\"model_1\" timeUnit=\"s\" volumeUnit=\"l\" quantityUnit=\"mol\" type=\"deterministic\">\n"
3014  " <Comment>\n"
3015  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
3016  " \n"
3017  " </body>\n"
3018  " </Comment>\n"
3019  " <ListOfCompartments>\n"
3020  " <Compartment key=\"Compartment_0\" name=\"compartment_1\" simulationType=\"fixed\">\n"
3021  " </Compartment>\n"
3022  " </ListOfCompartments>\n"
3023  " <ListOfMetabolites>\n"
3024  " <Metabolite key=\"Metabolite_0\" name=\"species_1\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
3025  " </Metabolite>\n"
3026  " </ListOfMetabolites>\n"
3027  " <ListOfModelValues>\n"
3028  " <ModelValue key=\"ModelValue_0\" name=\"parameter_1\" simulationType=\"fixed\">\n"
3029  " </ModelValue>\n"
3030  " </ListOfModelValues>\n"
3031  " <ListOfReactions>\n"
3032  " <Reaction key=\"Reaction_0\" name=\"reaction_1\" reversible=\"true\">\n"
3033  " <ListOfSubstrates>\n"
3034  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
3035  " </ListOfSubstrates>\n"
3036  " <ListOfConstants>\n"
3037  " <Constant key=\"Parameter_81\" name=\"parameter_1\" value=\"1\"/>\n"
3038  " </ListOfConstants>\n"
3039  " <KineticLaw function=\"Function_40\">\n"
3040  " <ListOfCallParameters>\n"
3041  " <CallParameter functionParameter=\"FunctionParameter_250\">\n"
3042  " <SourceParameter reference=\"ModelValue_0\"/>\n"
3043  " </CallParameter>\n"
3044  " <CallParameter functionParameter=\"FunctionParameter_254\">\n"
3045  " <SourceParameter reference=\"Metabolite_0\"/>\n"
3046  " </CallParameter>\n"
3047  " </ListOfCallParameters>\n"
3048  " </KineticLaw>\n"
3049  " </Reaction>\n"
3050  " </ListOfReactions>\n"
3051  " <StateTemplate>\n"
3052  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
3053  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
3054  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
3055  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
3056  " </StateTemplate>\n"
3057  " <InitialState type=\"initialState\">\n"
3058  " 0 6.0221415e+23 3 1e-16\n"
3059  " </InitialState>\n"
3060  " </Model>\n"
3061  " <SBMLReference file=\"test000059.xml\">\n"
3062  " <SBMLMap SBMLid=\"compartment_1\" COPASIkey=\"Compartment_0\"/>\n"
3063  " <SBMLMap SBMLid=\"function_1\" COPASIkey=\"Function_40\"/>\n"
3064  " <SBMLMap SBMLid=\"reaction_2\" COPASIkey=\"ModelValue_0\"/>\n"
3065  " <SBMLMap SBMLid=\"reaction_1\" COPASIkey=\"Reaction_0\"/>\n"
3066  " <SBMLMap SBMLid=\"species_1\" COPASIkey=\"Metabolite_0\"/>\n"
3067  " </SBMLReference>\n"
3068  "</COPASI>\n"
3069  ;
3070 
3071 const char* test000059::MODEL_STRING22 =
3072  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
3073  "<!-- generated with COPASI 4.4.29 (Debug) (http://www.copasi.org) at 2009-01-12 15:53:36 UTC -->\n"
3074  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"29\">\n"
3075  " <ListOfFunctions>\n"
3076  " <Function key=\"Function_14\" name=\"Mass action (reversible)\" type=\"MassAction\" reversible=\"true\">\n"
3077  " <Expression>\n"
3078  " k1*PRODUCT&lt;substrate_i&gt;-k2*PRODUCT&lt;product_j&gt;\n"
3079  " </Expression>\n"
3080  " <ListOfParameterDescriptions>\n"
3081  " <ParameterDescription key=\"FunctionParameter_62\" name=\"k1\" order=\"0\" role=\"constant\"/>\n"
3082  " <ParameterDescription key=\"FunctionParameter_39\" name=\"substrate\" order=\"1\" role=\"substrate\"/>\n"
3083  " <ParameterDescription key=\"FunctionParameter_67\" name=\"k2\" order=\"2\" role=\"constant\"/>\n"
3084  " <ParameterDescription key=\"FunctionParameter_71\" name=\"product\" order=\"3\" role=\"product\"/>\n"
3085  " </ListOfParameterDescriptions>\n"
3086  " </Function>\n"
3087  " </ListOfFunctions>\n"
3088  " <Model key=\"Model_1\" name=\"New Model\" timeUnit=\"s\" volumeUnit=\"ml\" quantityUnit=\"mmol\" type=\"deterministic\">\n"
3089  " <Comment>\n"
3090  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
3091  " \n"
3092  " </body>\n"
3093  " </Comment>\n"
3094  " <ListOfCompartments>\n"
3095  " <Compartment key=\"Compartment_0\" name=\"compartment\" simulationType=\"fixed\">\n"
3096  " </Compartment>\n"
3097  " </ListOfCompartments>\n"
3098  " <ListOfMetabolites>\n"
3099  " <Metabolite key=\"Metabolite_0\" name=\"A\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
3100  " </Metabolite>\n"
3101  " <Metabolite key=\"Metabolite_1\" name=\"B\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
3102  " </Metabolite>\n"
3103  " <Metabolite key=\"Metabolite_2\" name=\"C\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
3104  " </Metabolite>\n"
3105  " </ListOfMetabolites>\n"
3106  " <ListOfModelValues>\n"
3107  " <ModelValue key=\"ModelValue_0\" name=\"quantity\" simulationType=\"fixed\">\n"
3108  " <InitialExpression>\n"
3109  " &lt;CN=Root,Model=New Model,Vector=Reactions[reaction],ParameterGroup=Parameters,Parameter=k1,Reference=Value&gt;\n"
3110  " </InitialExpression>\n"
3111  " </ModelValue>\n"
3112  " <ModelValue key=\"ModelValue_1\" name=\"quantity_1\" simulationType=\"fixed\">\n"
3113  " <InitialExpression>\n"
3114  " 2*&lt;CN=Root,Model=New Model,Vector=Values[quantity],Reference=InitialValue&gt;\n"
3115  " </InitialExpression>\n"
3116  " </ModelValue>\n"
3117  " <ModelValue key=\"ModelValue_2\" name=\"quantity_2\" simulationType=\"assignment\">\n"
3118  " <Expression>\n"
3119  " 2*&lt;CN=Root,Model=New Model,Vector=Reactions[reaction],ParameterGroup=Parameters,Parameter=k2,Reference=Value&gt;\n"
3120  " </Expression>\n"
3121  " </ModelValue>\n"
3122  " </ListOfModelValues>\n"
3123  " <ListOfReactions>\n"
3124  " <Reaction key=\"Reaction_0\" name=\"reaction\" reversible=\"true\">\n"
3125  " <ListOfSubstrates>\n"
3126  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
3127  " <Substrate metabolite=\"Metabolite_1\" stoichiometry=\"2\"/>\n"
3128  " </ListOfSubstrates>\n"
3129  " <ListOfProducts>\n"
3130  " <Product metabolite=\"Metabolite_2\" stoichiometry=\"1\"/>\n"
3131  " </ListOfProducts>\n"
3132  " <ListOfConstants>\n"
3133  " <Constant key=\"Parameter_971\" name=\"k1\" value=\"0.1\"/>\n"
3134  " <Constant key=\"Parameter_970\" name=\"k2\" value=\"10\"/>\n"
3135  " </ListOfConstants>\n"
3136  " <KineticLaw function=\"Function_14\">\n"
3137  " <ListOfCallParameters>\n"
3138  " <CallParameter functionParameter=\"FunctionParameter_62\">\n"
3139  " <SourceParameter reference=\"Parameter_971\"/>\n"
3140  " </CallParameter>\n"
3141  " <CallParameter functionParameter=\"FunctionParameter_39\">\n"
3142  " <SourceParameter reference=\"Metabolite_0\"/>\n"
3143  " <SourceParameter reference=\"Metabolite_1\"/>\n"
3144  " <SourceParameter reference=\"Metabolite_1\"/>\n"
3145  " </CallParameter>\n"
3146  " <CallParameter functionParameter=\"FunctionParameter_67\">\n"
3147  " <SourceParameter reference=\"Parameter_970\"/>\n"
3148  " </CallParameter>\n"
3149  " <CallParameter functionParameter=\"FunctionParameter_71\">\n"
3150  " <SourceParameter reference=\"Metabolite_2\"/>\n"
3151  " </CallParameter>\n"
3152  " </ListOfCallParameters>\n"
3153  " </KineticLaw>\n"
3154  " </Reaction>\n"
3155  " </ListOfReactions>\n"
3156  " <StateTemplate>\n"
3157  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
3158  " <StateTemplateVariable objectReference=\"Metabolite_1\"/>\n"
3159  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
3160  " <StateTemplateVariable objectReference=\"Metabolite_2\"/>\n"
3161  " <StateTemplateVariable objectReference=\"ModelValue_2\"/>\n"
3162  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
3163  " <StateTemplateVariable objectReference=\"ModelValue_1\"/>\n"
3164  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
3165  " </StateTemplate>\n"
3166  " <InitialState type=\"initialState\">\n"
3167  " 0 6.022141500000001e+19 6.022141500000001e+19 6.022141500000001e+19 20 0.1 0.2 1\n"
3168  " </InitialState>\n"
3169  " </Model>\n"
3170  "</COPASI>\n";
void test_unique_id_10()
Definition: test000059.cpp:953
void test_unique_id_3()
Definition: test000059.cpp:635
SBMLDocument * getCurrentSBMLDocument()
void test_unique_id_7()
Definition: test000059.cpp:816
static const char * MODEL_STRING16
Definition: test000059.h:78
CFunction * addAndAdaptName(CFunction *pFunction)
static const char * MODEL_STRING17
Definition: test000059.h:79
Header file of class CModelEntity and CModelValue.
void test_unique_id_4()
Definition: test000059.cpp:680
static const char * MODEL_STRING22
Definition: test000059.h:84
static const char * MODEL_STRING4
Definition: test000059.h:66
void test_unique_id_19()
static const char * MODEL_STRING21
Definition: test000059.h:83
const CCopasiVector< CMetab > & getMetabolites() const
Definition: CModel.cpp:1051
const std::string & getObjectName() const
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000059.h:85
std::string exportSBMLToString(CProcessReport *pExportHandler, int sbmlLevel, int sbmlVersion)
static const char * MODEL_STRING3
Definition: test000059.h:65
void test_unique_id_1()
Definition: test000059.cpp:545
void test_unique_id_5()
Definition: test000059.cpp:726
static bool checkIfIdsUnique(const Model *pSBMLModel)
Definition: test000059.cpp:44
CCopasiObject * getInitialValueReference() const
void setParameterValue(const std::string &parameterName, const C_FLOAT64 &value, const bool &updateStatus=true)
Definition: CReaction.cpp:303
static const char * MODEL_STRING14
Definition: test000059.h:76
CCopasiObject * getValueReference() const
void test_unique_id_22()
bool addProduct(const std::string &metabKey, const C_FLOAT64 &multiplicity=1.0)
Definition: CReaction.cpp:236
void test_unique_id_13()
void test_unique_id_16()
CModelValue * createModelValue(const std::string &name, const C_FLOAT64 &value=0.0)
Definition: CModel.cpp:2838
Definition: CMetab.h:178
virtual bool setInfix(const std::string &infix)
Definition: CFunction.cpp:73
bool load_cps_model_from_stream(std::istream &is, CCopasiDataModel &dataModel)
Definition: utilities.cpp:21
void test_unique_id_12()
void test_unique_id_15()
virtual const std::string & getKey() const
static const char * MODEL_STRING7
Definition: test000059.h:69
void test_unique_id_20()
static const char * MODEL_STRING15
Definition: test000059.h:77
void test_unique_id_21_2()
bool setFunction(const std::string &functionName)
Definition: CReaction.cpp:255
virtual void setStatus(const CModelEntity::Status &status)
CReaction * createReaction(const std::string &name)
Definition: CModel.cpp:2760
static const char * MODEL_STRING19
Definition: test000059.h:81
void test_unique_id_8()
Definition: test000059.cpp:862
static const char * MODEL_STRING11
Definition: test000059.h:73
void test_unique_id_2()
Definition: test000059.cpp:590
CCopasiParameter * getParameter(const std::string &name)
static const char * MODEL_STRING1
Definition: test000059.h:63
static CFunctionDB * getFunctionList()
void test_unique_id_18()
static CCopasiDataModel * addDatamodel()
static const char * MODEL_STRING20
Definition: test000059.h:82
static const char * MODEL_STRING6
Definition: test000059.h:68
void test_unique_id_6()
Definition: test000059.cpp:771
void tearDown()
Definition: test000059.cpp:39
bool compileIfNecessary(CProcessReport *pProcessReport)
Definition: CModel.cpp:612
const CCopasiParameterGroup & getParameters() const
Definition: CReaction.cpp:333
void test_unique_id_21()
static const char * MODEL_STRING18
Definition: test000059.h:80
void test_unique_id_17()
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
static const char * MODEL_STRING9
Definition: test000059.h:71
virtual bool compile()
The class for handling a chemical kinetic function.
Definition: CFunction.h:29
static const char * MODEL_STRING8
Definition: test000059.h:70
static const char * MODEL_STRING12
Definition: test000059.h:74
static void init(int argc, char *argv[], const bool &withGui=false)
Definition: CModel.h:50
static const char * MODEL_STRING13
Definition: test000059.h:75
CConcentrationReference * getInitialConcentrationReference() const
Definition: CMetab.cpp:861
std::vector< Refresh * > buildInitialRefreshSequence(std::set< const CCopasiObject * > &changedObjects)
Definition: CModel.cpp:4164
void test_unique_id_11()
Definition: test000059.cpp:999
bool setExpression(const std::string &expression)
static const char * MODEL_STRING10
Definition: test000059.h:72
void test_unique_id_9()
Definition: test000059.cpp:907
static const char * MODEL_STRING2
Definition: test000059.h:64
void setUp()
Definition: test000059.cpp:31
void test_unique_id_14()
static const char * MODEL_STRING5
Definition: test000059.h:67
CMetab * createMetabolite(const std::string &name, const std::string &compartment, const C_FLOAT64 &iconc=1.0, const CModelEntity::Status &status=CModelEntity::REACTIONS)
Definition: CModel.cpp:2622