COPASI API  4.16.103
test000095.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/sbml/unittests/test000095.cpp,v $
3 // $Revision: 1.3 $
4 // $Name: $
5 // $Author: bergmann $
6 // $Date: 2012/05/16 06:24:49 $
7 // End CVS Header
8 
9 // Copyright (C) 2012 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 #include "test000095.h"
15 
16 #include <sstream>
17 #include "utilities.hpp"
19 #include "copasi/model/CModel.h"
21 #include "copasi/model/CEvent.h"
22 
23 #include "sbml/math/ASTNode.h"
24 #include "sbml/SBMLDocument.h"
25 #include "sbml/Model.h"
26 #include "sbml/Compartment.h"
27 #include "sbml/Parameter.h"
28 #include "sbml/Event.h"
29 #include "sbml/Trigger.h"
30 #include "sbml/Delay.h"
31 #include "sbml/EventAssignment.h"
32 
34 
35 CCopasiDataModel* test000095::pCOPASIDATAMODEL = NULL;
36 
38 {
39  // Create the root container.
40  CCopasiRootContainer::init(0, NULL, false);
41  // Create the global data model.
43 }
44 
46 {
48 }
49 
51 {
52  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
53  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING1));
54  CModel* pModel = pDataModel->getModel();
55  CPPUNIT_ASSERT(pModel != NULL);
56  CPPUNIT_ASSERT(pModel->getCompartments().size() == 0);
57  CPPUNIT_ASSERT(pModel->getMetabolites().size() == 0);
58  CPPUNIT_ASSERT(pModel->getModelValues().size() == 1);
59  const CModelValue* pModelValue = pModel->getModelValues()[0];
60  CPPUNIT_ASSERT(pModelValue != NULL);
61  CPPUNIT_ASSERT(pModel->getEvents().size() == 1);
62  const CEvent* pEvent = pModel->getEvents()[0];
63  CPPUNIT_ASSERT(pEvent != NULL);
64 
65  // check the trigger expression
66  const CExpression* pExpr = pEvent->getTriggerExpressionPtr();
67  CPPUNIT_ASSERT(pExpr != NULL);
68  const CEvaluationNode* pNode = pExpr->getRoot();
69  CPPUNIT_ASSERT(pNode != NULL);
70  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::LOGICAL);
72  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getChild());
73  CPPUNIT_ASSERT(pNode != NULL);
74  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::OBJECT);
75  const CEvaluationNodeObject* pObjectNode = dynamic_cast<const CEvaluationNodeObject*>(pNode);
76  CPPUNIT_ASSERT(pObjectNode != NULL);
77  CCopasiObjectName objectCN = pObjectNode->getObjectCN();
78  CPPUNIT_ASSERT(!objectCN.empty());
79  std::vector<CCopasiContainer*> listOfContainers;
80  listOfContainers.push_back(pModel);
81  const CCopasiObject* pObject = pCOPASIDATAMODEL->ObjectFromName(listOfContainers, objectCN);
82  CPPUNIT_ASSERT(pObject != NULL);
83  CPPUNIT_ASSERT(pObject->isReference() == true);
84  CPPUNIT_ASSERT(pObject->getObjectName() == std::string("Time"));
85  CPPUNIT_ASSERT(pObject->getObjectParent() == pModel);
86  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getSibling());
87  CPPUNIT_ASSERT(pNode != NULL);
88  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
89  const CEvaluationNodeNumber* pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
90  CPPUNIT_ASSERT(pNumberNode != NULL);
91  CPPUNIT_ASSERT(fabs((pNumberNode->getValue() - 2.0) / 2.0) < 1e-6);
92  // check that there is a delay
93 
94  CPPUNIT_ASSERT(pEvent->getAssignments().size() == 1);
95  // check the event assignment
96  std::string key = pEvent->getAssignments()[0]->getTargetKey();
97  CPPUNIT_ASSERT(key == pModelValue->getKey());
98  pExpr = pEvent->getAssignments()[0]->getExpressionPtr();
99  CPPUNIT_ASSERT(pExpr != NULL);
100  pNode = pExpr->getRoot();
101  CPPUNIT_ASSERT(pNode != NULL);
102  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
103  pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
104  CPPUNIT_ASSERT(pNumberNode != NULL);
105  CPPUNIT_ASSERT((fabs(pNumberNode->getValue() - 8.0) / 8.0) < 1e-9);
106 
107  // check that the message stack contains a warning about event priorities
108  // MCSBML + 98
109  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 97) == false);
110  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 98) == true);
111  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 99) == false);
112 }
113 
115 {
116  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
117  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING2));
118  CModel* pModel = pDataModel->getModel();
119  CPPUNIT_ASSERT(pModel != NULL);
120  CPPUNIT_ASSERT(pModel->getCompartments().size() == 0);
121  CPPUNIT_ASSERT(pModel->getMetabolites().size() == 0);
122  CPPUNIT_ASSERT(pModel->getModelValues().size() == 1);
123  const CModelValue* pModelValue = pModel->getModelValues()[0];
124  CPPUNIT_ASSERT(pModelValue != NULL);
125  CPPUNIT_ASSERT(pModel->getEvents().size() == 1);
126  const CEvent* pEvent = pModel->getEvents()[0];
127  CPPUNIT_ASSERT(pEvent != NULL);
128 
129  // check the trigger expression
130  const CExpression* pExpr = pEvent->getTriggerExpressionPtr();
131  CPPUNIT_ASSERT(pExpr != NULL);
132  const CEvaluationNode* pNode = pExpr->getRoot();
133  CPPUNIT_ASSERT(pNode != NULL);
134  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::LOGICAL);
136  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getChild());
137  CPPUNIT_ASSERT(pNode != NULL);
138  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::OBJECT);
139  const CEvaluationNodeObject* pObjectNode = dynamic_cast<const CEvaluationNodeObject*>(pNode);
140  CPPUNIT_ASSERT(pObjectNode != NULL);
141  CCopasiObjectName objectCN = pObjectNode->getObjectCN();
142  CPPUNIT_ASSERT(!objectCN.empty());
143  std::vector<CCopasiContainer*> listOfContainers;
144  listOfContainers.push_back(pModel);
145  const CCopasiObject* pObject = pCOPASIDATAMODEL->ObjectFromName(listOfContainers, objectCN);
146  CPPUNIT_ASSERT(pObject != NULL);
147  CPPUNIT_ASSERT(pObject->isReference() == true);
148  CPPUNIT_ASSERT(pObject->getObjectName() == std::string("Time"));
149  CPPUNIT_ASSERT(pObject->getObjectParent() == pModel);
150  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getSibling());
151  CPPUNIT_ASSERT(pNode != NULL);
152  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
153  const CEvaluationNodeNumber* pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
154  CPPUNIT_ASSERT(pNumberNode != NULL);
155  CPPUNIT_ASSERT(fabs((pNumberNode->getValue() - 2.0) / 2.0) < 1e-6);
156  // check that there is a delay
157 
158  CPPUNIT_ASSERT(pEvent->getAssignments().size() == 1);
159  // check the event assignment
160  std::string key = pEvent->getAssignments()[0]->getTargetKey();
161  CPPUNIT_ASSERT(key == pModelValue->getKey());
162  pExpr = pEvent->getAssignments()[0]->getExpressionPtr();
163  CPPUNIT_ASSERT(pExpr != NULL);
164  pNode = pExpr->getRoot();
165  CPPUNIT_ASSERT(pNode != NULL);
166  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
167  pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
168  CPPUNIT_ASSERT(pNumberNode != NULL);
169  CPPUNIT_ASSERT((fabs(pNumberNode->getValue() - 8.0) / 8.0) < 1e-9);
170 
171 
172  // check that the message stack contains a warning about initial values for triggers
173  // MCSBML + 97
174  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 97) == true);
175  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 98) == false);
176  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 99) == false);
177 }
178 
180 {
181  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
182  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING3));
183  CModel* pModel = pDataModel->getModel();
184  CPPUNIT_ASSERT(pModel != NULL);
185  CPPUNIT_ASSERT(pModel->getCompartments().size() == 0);
186  CPPUNIT_ASSERT(pModel->getMetabolites().size() == 0);
187  CPPUNIT_ASSERT(pModel->getModelValues().size() == 1);
188  const CModelValue* pModelValue = pModel->getModelValues()[0];
189  CPPUNIT_ASSERT(pModelValue != NULL);
190  CPPUNIT_ASSERT(pModel->getEvents().size() == 1);
191  const CEvent* pEvent = pModel->getEvents()[0];
192  CPPUNIT_ASSERT(pEvent != NULL);
193 
194  // check the trigger expression
195  const CExpression* pExpr = pEvent->getTriggerExpressionPtr();
196  CPPUNIT_ASSERT(pExpr != NULL);
197  const CEvaluationNode* pNode = pExpr->getRoot();
198  CPPUNIT_ASSERT(pNode != NULL);
199  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::LOGICAL);
201  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getChild());
202  CPPUNIT_ASSERT(pNode != NULL);
203  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::OBJECT);
204  const CEvaluationNodeObject* pObjectNode = dynamic_cast<const CEvaluationNodeObject*>(pNode);
205  CPPUNIT_ASSERT(pObjectNode != NULL);
206  CCopasiObjectName objectCN = pObjectNode->getObjectCN();
207  CPPUNIT_ASSERT(!objectCN.empty());
208  std::vector<CCopasiContainer*> listOfContainers;
209  listOfContainers.push_back(pModel);
210  const CCopasiObject* pObject = pCOPASIDATAMODEL->ObjectFromName(listOfContainers, objectCN);
211  CPPUNIT_ASSERT(pObject != NULL);
212  CPPUNIT_ASSERT(pObject->isReference() == true);
213  CPPUNIT_ASSERT(pObject->getObjectName() == std::string("Time"));
214  CPPUNIT_ASSERT(pObject->getObjectParent() == pModel);
215  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getSibling());
216  CPPUNIT_ASSERT(pNode != NULL);
217  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
218  const CEvaluationNodeNumber* pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
219  CPPUNIT_ASSERT(pNumberNode != NULL);
220  CPPUNIT_ASSERT(fabs((pNumberNode->getValue() - 2.0) / 2.0) < 1e-6);
221  // check that there is a delay
222 
223  CPPUNIT_ASSERT(pEvent->getAssignments().size() == 1);
224  // check the event assignment
225  std::string key = pEvent->getAssignments()[0]->getTargetKey();
226  CPPUNIT_ASSERT(key == pModelValue->getKey());
227  pExpr = pEvent->getAssignments()[0]->getExpressionPtr();
228  CPPUNIT_ASSERT(pExpr != NULL);
229  pNode = pExpr->getRoot();
230  CPPUNIT_ASSERT(pNode != NULL);
231  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
232  pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
233  CPPUNIT_ASSERT(pNumberNode != NULL);
234  CPPUNIT_ASSERT((fabs(pNumberNode->getValue() - 8.0) / 8.0) < 1e-9);
235 
236  // check that the message stack contains a warning about event priorities
237  // MCSBML + 98
238  // check that the message stack contains a warning about initial values for triggers
239  // MCSBML + 97
240  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 97) == true);
241  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 98) == true);
242  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 99) == false);
243 }
244 
246 {
247  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
248  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING4));
249  CModel* pModel = pDataModel->getModel();
250  CPPUNIT_ASSERT(pModel != NULL);
251  CPPUNIT_ASSERT(pModel->getCompartments().size() == 0);
252  CPPUNIT_ASSERT(pModel->getMetabolites().size() == 0);
253  CPPUNIT_ASSERT(pModel->getModelValues().size() == 1);
254  const CModelValue* pModelValue = pModel->getModelValues()[0];
255  CPPUNIT_ASSERT(pModelValue != NULL);
256  CPPUNIT_ASSERT(pModel->getEvents().size() == 1);
257  const CEvent* pEvent = pModel->getEvents()[0];
258  CPPUNIT_ASSERT(pEvent != NULL);
259 
260  // check the trigger expression
261  const CExpression* pExpr = pEvent->getTriggerExpressionPtr();
262  CPPUNIT_ASSERT(pExpr != NULL);
263  const CEvaluationNode* pNode = pExpr->getRoot();
264  CPPUNIT_ASSERT(pNode != NULL);
265  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::LOGICAL);
267  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getChild());
268  CPPUNIT_ASSERT(pNode != NULL);
269  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::OBJECT);
270  const CEvaluationNodeObject* pObjectNode = dynamic_cast<const CEvaluationNodeObject*>(pNode);
271  CPPUNIT_ASSERT(pObjectNode != NULL);
272  CCopasiObjectName objectCN = pObjectNode->getObjectCN();
273  CPPUNIT_ASSERT(!objectCN.empty());
274  std::vector<CCopasiContainer*> listOfContainers;
275  listOfContainers.push_back(pModel);
276  const CCopasiObject* pObject = pCOPASIDATAMODEL->ObjectFromName(listOfContainers, objectCN);
277  CPPUNIT_ASSERT(pObject != NULL);
278  CPPUNIT_ASSERT(pObject->isReference() == true);
279  CPPUNIT_ASSERT(pObject->getObjectName() == std::string("Time"));
280  CPPUNIT_ASSERT(pObject->getObjectParent() == pModel);
281  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getSibling());
282  CPPUNIT_ASSERT(pNode != NULL);
283  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
284  const CEvaluationNodeNumber* pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
285  CPPUNIT_ASSERT(pNumberNode != NULL);
286  CPPUNIT_ASSERT(fabs((pNumberNode->getValue() - 2.0) / 2.0) < 1e-6);
287  // check that there is a delay
288 
289  CPPUNIT_ASSERT(pEvent->getAssignments().size() == 1);
290  // check the event assignment
291  std::string key = pEvent->getAssignments()[0]->getTargetKey();
292  CPPUNIT_ASSERT(key == pModelValue->getKey());
293  pExpr = pEvent->getAssignments()[0]->getExpressionPtr();
294  CPPUNIT_ASSERT(pExpr != NULL);
295  pNode = pExpr->getRoot();
296  CPPUNIT_ASSERT(pNode != NULL);
297  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
298  pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
299  CPPUNIT_ASSERT(pNumberNode != NULL);
300  CPPUNIT_ASSERT((fabs(pNumberNode->getValue() - 8.0) / 8.0) < 1e-9);
301 
302  // check that the message stack contains a warning about non-persistent triggers
303  // MCSBML + 99
304  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 97) == false);
305  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 98) == false);
306  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 99) == true);
307 }
308 
310 {
311  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;
312  CPPUNIT_ASSERT(pDataModel->importSBMLFromString(MODEL_STRING5));
313  CModel* pModel = pDataModel->getModel();
314  CPPUNIT_ASSERT(pModel != NULL);
315  CPPUNIT_ASSERT(pModel->getCompartments().size() == 0);
316  CPPUNIT_ASSERT(pModel->getMetabolites().size() == 0);
317  CPPUNIT_ASSERT(pModel->getModelValues().size() == 1);
318  const CModelValue* pModelValue = pModel->getModelValues()[0];
319  CPPUNIT_ASSERT(pModelValue != NULL);
320  CPPUNIT_ASSERT(pModel->getEvents().size() == 1);
321  const CEvent* pEvent = pModel->getEvents()[0];
322  CPPUNIT_ASSERT(pEvent != NULL);
323 
324  // check the trigger expression
325  const CExpression* pExpr = pEvent->getTriggerExpressionPtr();
326  CPPUNIT_ASSERT(pExpr != NULL);
327  const CEvaluationNode* pNode = pExpr->getRoot();
328  CPPUNIT_ASSERT(pNode != NULL);
329  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::LOGICAL);
331  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getChild());
332  CPPUNIT_ASSERT(pNode != NULL);
333  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::OBJECT);
334  const CEvaluationNodeObject* pObjectNode = dynamic_cast<const CEvaluationNodeObject*>(pNode);
335  CPPUNIT_ASSERT(pObjectNode != NULL);
336  CCopasiObjectName objectCN = pObjectNode->getObjectCN();
337  CPPUNIT_ASSERT(!objectCN.empty());
338  std::vector<CCopasiContainer*> listOfContainers;
339  listOfContainers.push_back(pModel);
340  const CCopasiObject* pObject = pCOPASIDATAMODEL->ObjectFromName(listOfContainers, objectCN);
341  CPPUNIT_ASSERT(pObject != NULL);
342  CPPUNIT_ASSERT(pObject->isReference() == true);
343  CPPUNIT_ASSERT(pObject->getObjectName() == std::string("Time"));
344  CPPUNIT_ASSERT(pObject->getObjectParent() == pModel);
345  pNode = dynamic_cast<const CEvaluationNode*>(pNode->getSibling());
346  CPPUNIT_ASSERT(pNode != NULL);
347  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
348  const CEvaluationNodeNumber* pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
349  CPPUNIT_ASSERT(pNumberNode != NULL);
350  CPPUNIT_ASSERT(fabs((pNumberNode->getValue() - 2.0) / 2.0) < 1e-6);
351  // check that there is a delay
352 
353  CPPUNIT_ASSERT(pEvent->getAssignments().size() == 1);
354  // check the event assignment
355  std::string key = pEvent->getAssignments()[0]->getTargetKey();
356  CPPUNIT_ASSERT(key == pModelValue->getKey());
357  pExpr = pEvent->getAssignments()[0]->getExpressionPtr();
358  CPPUNIT_ASSERT(pExpr != NULL);
359  pNode = pExpr->getRoot();
360  CPPUNIT_ASSERT(pNode != NULL);
361  CPPUNIT_ASSERT(CEvaluationNode::type(pNode->getType()) == CEvaluationNode::NUMBER);
362  pNumberNode = dynamic_cast<const CEvaluationNodeNumber*>(pNode);
363  CPPUNIT_ASSERT(pNumberNode != NULL);
364  CPPUNIT_ASSERT((fabs(pNumberNode->getValue() - 8.0) / 8.0) < 1e-9);
365 
366  // check that there is no MCSBML + 97, MCSBML + 98 or MCSBML + 99 error message
367  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 97) == false);
368  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 98) == false);
369  CPPUNIT_ASSERT(CCopasiMessage::checkForMessage(MCSBML + 99) == false);
370 }
371 
372 const char* test000095::MODEL_STRING1 =
373  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
374  "<sbml xmlns=\"http://www.sbml.org/sbml/level3/version1/core\" level=\"3\" version=\"1\">"
375  " <model id=\"Model_1\" name=\"New Model\">"
376  " <notes>"
377  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
378  " <p>L3V1 model with event priority.</p>"
379  " </body>"
380  " </notes>"
381  " <listOfParameters>"
382  " <parameter id=\"parameter_1\" name=\"K\" value=\"0\" constant=\"false\"/>"
383  " </listOfParameters>"
384  " <listOfEvents>"
385  " <event>"
386  " <trigger initialValue=\"true\" persistent=\"true\">"
387  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
388  " <apply>"
389  " <gt/>"
390  " <csymbol encoding=\"text\" definitionURL=\"http://www.sbml.org/sbml/symbols/time\"> time </csymbol>"
391  " <cn> 2.0 </cn>"
392  " </apply>"
393  " </math>"
394  " </trigger>"
395  " <priority>"
396  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
397  " <cn> 2.0 </cn>"
398  " </math>"
399  " </priority>"
400  " <listOfEventAssignments>"
401  " <eventAssignment variable=\"parameter_1\">"
402  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
403  " <cn> 8.0 </cn>"
404  " </math>"
405  " </eventAssignment>"
406  " </listOfEventAssignments>"
407  " </event>"
408  " </listOfEvents>"
409  " </model>"
410  "</sbml>"
411  ;
412 
413 const char* test000095::MODEL_STRING2 =
414  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
415  "<sbml xmlns=\"http://www.sbml.org/sbml/level3/version1/core\" level=\"3\" version=\"1\">"
416  " <model id=\"Model_1\" name=\"New Model\">"
417  " <notes>"
418  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
419  " <p>L3V1 model with event priority.</p>"
420  " </body>"
421  " </notes>"
422  " <listOfParameters>"
423  " <parameter id=\"parameter_1\" name=\"K\" value=\"0\" constant=\"false\"/>"
424  " </listOfParameters>"
425  " <listOfEvents>"
426  " <event>"
427  " <trigger initialValue=\"false\" persistent=\"true\" >"
428  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
429  " <apply>"
430  " <gt/>"
431  " <csymbol encoding=\"text\" definitionURL=\"http://www.sbml.org/sbml/symbols/time\"> time </csymbol>"
432  " <cn> 2.0 </cn>"
433  " </apply>"
434  " </math>"
435  " </trigger>"
436  " <listOfEventAssignments>"
437  " <eventAssignment variable=\"parameter_1\">"
438  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
439  " <cn> 8.0 </cn>"
440  " </math>"
441  " </eventAssignment>"
442  " </listOfEventAssignments>"
443  " </event>"
444  " </listOfEvents>"
445  " </model>"
446  "</sbml>"
447  ;
448 
449 
450 const char* test000095::MODEL_STRING3 =
451  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
452  "<sbml xmlns=\"http://www.sbml.org/sbml/level3/version1/core\" level=\"3\" version=\"1\">"
453  " <model id=\"Model_1\" name=\"New Model\">"
454  " <notes>"
455  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
456  " <p>L3V1 model with event priority.</p>"
457  " </body>"
458  " </notes>"
459  " <listOfParameters>"
460  " <parameter id=\"parameter_1\" name=\"K\" value=\"0\" constant=\"false\"/>"
461  " </listOfParameters>"
462  " <listOfEvents>"
463  " <event>"
464  " <trigger initialValue=\"false\" persistent=\"true\" >"
465  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
466  " <apply>"
467  " <gt/>"
468  " <csymbol encoding=\"text\" definitionURL=\"http://www.sbml.org/sbml/symbols/time\"> time </csymbol>"
469  " <cn> 2.0 </cn>"
470  " </apply>"
471  " </math>"
472  " </trigger>"
473  " <priority>"
474  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
475  " <cn> 2.0 </cn>"
476  " </math>"
477  " </priority>"
478  " <listOfEventAssignments>"
479  " <eventAssignment variable=\"parameter_1\">"
480  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
481  " <cn> 8.0 </cn>"
482  " </math>"
483  " </eventAssignment>"
484  " </listOfEventAssignments>"
485  " </event>"
486  " </listOfEvents>"
487  " </model>"
488  "</sbml>"
489  ;
490 
491 const char* test000095::MODEL_STRING4 =
492  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
493  "<sbml xmlns=\"http://www.sbml.org/sbml/level3/version1/core\" level=\"3\" version=\"1\">"
494  " <model id=\"Model_1\" name=\"New Model\">"
495  " <notes>"
496  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
497  " <p>L3V1 model with event priority.</p>"
498  " </body>"
499  " </notes>"
500  " <listOfParameters>"
501  " <parameter id=\"parameter_1\" name=\"K\" value=\"0\" constant=\"false\"/>"
502  " </listOfParameters>"
503  " <listOfEvents>"
504  " <event>"
505  " <trigger initialValue=\"true\" persistent=\"false\" >"
506  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
507  " <apply>"
508  " <gt/>"
509  " <csymbol encoding=\"text\" definitionURL=\"http://www.sbml.org/sbml/symbols/time\"> time </csymbol>"
510  " <cn> 2.0 </cn>"
511  " </apply>"
512  " </math>"
513  " </trigger>"
514  " <listOfEventAssignments>"
515  " <eventAssignment variable=\"parameter_1\">"
516  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
517  " <cn> 8.0 </cn>"
518  " </math>"
519  " </eventAssignment>"
520  " </listOfEventAssignments>"
521  " </event>"
522  " </listOfEvents>"
523  " </model>"
524  "</sbml>"
525  ;
526 
527 const char* test000095::MODEL_STRING5 =
528  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
529  "<sbml xmlns=\"http://www.sbml.org/sbml/level3/version1/core\" level=\"3\" version=\"1\">"
530  " <model id=\"Model_1\" name=\"New Model\">"
531  " <notes>"
532  " <body xmlns=\"http://www.w3.org/1999/xhtml\">"
533  " <p>L3V1 model with event priority.</p>"
534  " </body>"
535  " </notes>"
536  " <listOfParameters>"
537  " <parameter id=\"parameter_1\" name=\"K\" value=\"0\" constant=\"false\"/>"
538  " </listOfParameters>"
539  " <listOfEvents>"
540  " <event>"
541  " <trigger initialValue=\"true\" persistent=\"true\" >"
542  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
543  " <apply>"
544  " <gt/>"
545  " <csymbol encoding=\"text\" definitionURL=\"http://www.sbml.org/sbml/symbols/time\"> time </csymbol>"
546  " <cn> 2.0 </cn>"
547  " </apply>"
548  " </math>"
549  " </trigger>"
550  " <listOfEventAssignments>"
551  " <eventAssignment variable=\"parameter_1\">"
552  " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">"
553  " <cn> 8.0 </cn>"
554  " </math>"
555  " </eventAssignment>"
556  " </listOfEventAssignments>"
557  " </event>"
558  " </listOfEvents>"
559  " </model>"
560  "</sbml>"
561  ;
562 
563 
Definition: CEvent.h:152
Header file of class CModelEntity and CModelValue.
const std::string & getObjectName() const
const CRegisteredObjectName & getObjectCN() const
const C_FLOAT64 & getValue() const
static const char * MODEL_STRING3
Definition: test000095.h:49
void tearDown()
Definition: test000095.cpp:45
const Type & getType() const
static Type type(const Type &type)
#define MCSBML
static const char * MODEL_STRING2
Definition: test000095.h:46
bool isReference() const
void setUp()
Definition: test000095.cpp:37
static const char * MODEL_STRING4
Definition: test000095.h:52
static const char * MODEL_STRING1
Definition: test000095.h:43
void test_import_l3_event_5()
Definition: test000095.cpp:309
static CCopasiDataModel * addDatamodel()
static Type subType(const Type &type)
static CCopasiDataModel * pCOPASIDATAMODEL
Definition: test000095.h:57
static bool checkForMessage(const size_t &number)
void test_import_l3_event_3()
Definition: test000095.cpp:179
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
static void init(int argc, char *argv[], const bool &withGui=false)
Definition: CModel.h:50
Header file of class CEvent.
void test_import_l3_event_2()
Definition: test000095.cpp:114
void test_import_l3_event_1()
Definition: test000095.cpp:50
CCopasiNode< Data > * getChild()
Definition: CCopasiNode.h:210
CCopasiObject * ObjectFromName(const std::vector< CCopasiContainer * > &listOfContainer, const CCopasiObjectName &CN) const
CEvaluationNode * getRoot()
CCopasiContainer * getObjectParent() const
static const char * MODEL_STRING5
Definition: test000095.h:55
void test_import_l3_event_4()
Definition: test000095.cpp:245