COPASI API  4.16.103
test_compare_utilities.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) 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 "test_compare_utilities.h"
12 
13 #include <sstream>
14 
15 #include "copasi/sbml/unittests/utilities.hpp"
16 
19 #include "copasi/model/CModel.h"
22 
23 CCopasiDataModel* test_compare_utilities::pCOPASIDATAMODEL = NULL;
24 
26 {
27  // Create the root container.
28  CCopasiRootContainer::init(false, 0, NULL);
29 
30  // Create the global data model.
32 }
33 
35 {
37 }
38 
40 {
41  CCopasiDataModel* pDataModel = pCOPASIDATAMODEL;;
42  std::istringstream iss(test_compare_utilities::MODEL_STRING1);
43  CPPUNIT_ASSERT(load_cps_model_from_stream(iss, *pDataModel) == true);
45  // function_5
46  CEvaluationTree* pTree = pFunctionDB->findFunction("function_4");
47  CPPUNIT_ASSERT(pTree != NULL);
48  // generate a call node
49  CFunction* pFunction = dynamic_cast<CFunction*>(pTree);
50  CPPUNIT_ASSERT(pFunction != NULL);
52  CPPUNIT_ASSERT(pCallNode != NULL);
53  CFunctionParameters* pFunctionParameters = &pFunction->getVariables();
54  unsigned int i = 0, iMax = pFunctionParameters->size();
55 
56  while (i < iMax)
57  {
58  CFunctionParameter* pParameter = (*pFunctionParameters)[i];
59  CPPUNIT_ASSERT(pParameter != NULL);
61  pCallNode->addChild(pVariableNode);
62  ++i;
63  }
64 
65  CEvaluationNode* pExpanded = expand_function_calls(pCallNode, pFunctionDB);
66  delete pCallNode;
67  CPPUNIT_ASSERT(pExpanded != NULL);
68  CPPUNIT_ASSERT(CEvaluationNode::type(pExpanded->getType()) == CEvaluationNode::OPERATOR);
70  CEvaluationNode* pChild = dynamic_cast<CEvaluationNode*>(pExpanded->getChild());
71  CPPUNIT_ASSERT(pChild != NULL);
72  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
74  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
75  CPPUNIT_ASSERT(pChild != NULL);
76  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::VARIABLE);
77  CPPUNIT_ASSERT(pChild->getData() == std::string("y"));
78  pChild = dynamic_cast<CEvaluationNode*>(pChild->getSibling());
79  CPPUNIT_ASSERT(pChild != NULL);
80  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::VARIABLE);
81  CPPUNIT_ASSERT(pChild->getData() == std::string("x"));
82  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
83  pChild = dynamic_cast<CEvaluationNode*>(pExpanded->getChild()->getSibling());
84  CPPUNIT_ASSERT(pChild != NULL);
85  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::NUMBER);
87  CPPUNIT_ASSERT((fabs(pChild->getValue() - 2.0) / 2.0) < 1e-6);
88  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
89  delete pExpanded;
90 
91  // function_5
92  pTree = pFunctionDB->findFunction("function_5");
93  CPPUNIT_ASSERT(pTree != NULL);
94  // generate a call node
95  pFunction = dynamic_cast<CFunction*>(pTree);
96  CPPUNIT_ASSERT(pFunction != NULL);
98  CPPUNIT_ASSERT(pCallNode != NULL);
99  pFunctionParameters = &pFunction->getVariables();
100  i = 0, iMax = pFunctionParameters->size();
101 
102  while (i < iMax)
103  {
104  CFunctionParameter* pParameter = (*pFunctionParameters)[i];
105  CPPUNIT_ASSERT(pParameter != NULL);
107  pCallNode->addChild(pVariableNode);
108  ++i;
109  }
110 
111  pExpanded = expand_function_calls(pCallNode, pFunctionDB);
112  delete pCallNode;
113  CPPUNIT_ASSERT(pExpanded != NULL);
114  CPPUNIT_ASSERT(CEvaluationNode::type(pExpanded->getType()) == CEvaluationNode::OPERATOR);
116  pChild = dynamic_cast<CEvaluationNode*>(pExpanded->getChild());
117  CPPUNIT_ASSERT(pChild != NULL);
118  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
120  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
121  CPPUNIT_ASSERT(pChild != NULL);
122  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::VARIABLE);
123  CPPUNIT_ASSERT(pChild->getData() == std::string("a"));
124  pChild = dynamic_cast<CEvaluationNode*>(pChild->getSibling());
125  CPPUNIT_ASSERT(pChild != NULL);
126  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
128  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
129  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
130  CPPUNIT_ASSERT(pChild != NULL);
131  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::VARIABLE);
132  CPPUNIT_ASSERT(pChild->getData() == std::string("c"));
133  pChild = dynamic_cast<CEvaluationNode*>(pChild->getSibling());
134  CPPUNIT_ASSERT(pChild != NULL);
135  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::NUMBER);
137  CPPUNIT_ASSERT((fabs(pChild->getValue() - 1.3) / 1.3) < 1e-6);
138  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
139 
140  // (3*b)-5.23
141  pChild = dynamic_cast<CEvaluationNode*>(pExpanded->getChild()->getSibling());
142  CPPUNIT_ASSERT(pChild != NULL);
143  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
145  // 3*b
146  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
147  CPPUNIT_ASSERT(pChild != NULL);
148  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
150  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
151  CPPUNIT_ASSERT(pChild != NULL);
152  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::NUMBER);
154  CPPUNIT_ASSERT((fabs(pChild->getValue() - 3.0) / 3.0) < 1e-6);
155  pChild = dynamic_cast<CEvaluationNode*>(pChild->getSibling());
156  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::VARIABLE);
157  CPPUNIT_ASSERT(pChild->getData() == std::string("b"));
158  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
159  // 5.23
160  pChild = dynamic_cast<CEvaluationNode*>(pExpanded->getChild()->getSibling()->getChild()->getSibling());
161  CPPUNIT_ASSERT(pChild != NULL);
162  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::NUMBER);
164  CPPUNIT_ASSERT((fabs(pChild->getValue() - 5.23) / 5.23) < 1e-6);
165  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
166 
167  delete pExpanded;
168 
169  // function_6
170  pTree = pFunctionDB->findFunction("function_6");
171  CPPUNIT_ASSERT(pTree != NULL);
172  // generate a call node
173  pFunction = dynamic_cast<CFunction*>(pTree);
174  CPPUNIT_ASSERT(pFunction != NULL);
175  pCallNode = new CEvaluationNodeCall(CEvaluationNodeCall::FUNCTION, pFunction->getObjectName());
176  CPPUNIT_ASSERT(pCallNode != NULL);
177  pFunctionParameters = &pFunction->getVariables();
178  i = 0, iMax = pFunctionParameters->size();
179 
180  while (i < iMax)
181  {
182  CFunctionParameter* pParameter = (*pFunctionParameters)[i];
183  CPPUNIT_ASSERT(pParameter != NULL);
185  pCallNode->addChild(pVariableNode);
186  ++i;
187  }
188 
189  pExpanded = expand_function_calls(pCallNode, pFunctionDB);
190  delete pCallNode;
191  CPPUNIT_ASSERT(pExpanded != NULL);
192  // (k1-k3*1.3)+((3*k2)-5.23)
193  CPPUNIT_ASSERT(CEvaluationNode::type(pExpanded->getType()) == CEvaluationNode::OPERATOR);
195  pChild = dynamic_cast<CEvaluationNode*>(pExpanded->getChild());
196  CPPUNIT_ASSERT(pChild != NULL);
197  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
199  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
200  CPPUNIT_ASSERT(pChild != NULL);
201  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::VARIABLE);
202  CPPUNIT_ASSERT(pChild->getData() == std::string("k1"));
203  pChild = dynamic_cast<CEvaluationNode*>(pChild->getSibling());
204  CPPUNIT_ASSERT(pChild != NULL);
205  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
207  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
208  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
209  CPPUNIT_ASSERT(pChild != NULL);
210  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::VARIABLE);
211  CPPUNIT_ASSERT(pChild->getData() == std::string("k3"));
212  pChild = dynamic_cast<CEvaluationNode*>(pChild->getSibling());
213  CPPUNIT_ASSERT(pChild != NULL);
214  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::NUMBER);
216  CPPUNIT_ASSERT((fabs(pChild->getValue() - 1.3) / 1.3) < 1e-6);
217  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
218 
219  // (3*b)-5.23
220  pChild = dynamic_cast<CEvaluationNode*>(pExpanded->getChild()->getSibling());
221  CPPUNIT_ASSERT(pChild != NULL);
222  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
224  // 3*b
225  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
226  CPPUNIT_ASSERT(pChild != NULL);
227  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::OPERATOR);
229  pChild = dynamic_cast<CEvaluationNode*>(pChild->getChild());
230  CPPUNIT_ASSERT(pChild != NULL);
231  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::NUMBER);
233  CPPUNIT_ASSERT((fabs(pChild->getValue() - 3.0) / 3.0) < 1e-6);
234  pChild = dynamic_cast<CEvaluationNode*>(pChild->getSibling());
235  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::VARIABLE);
236  CPPUNIT_ASSERT(pChild->getData() == std::string("k2"));
237  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
238  // 5.23
239  pChild = dynamic_cast<CEvaluationNode*>(pExpanded->getChild()->getSibling()->getChild()->getSibling());
240  CPPUNIT_ASSERT(pChild != NULL);
241  CPPUNIT_ASSERT(CEvaluationNode::type(pChild->getType()) == CEvaluationNode::NUMBER);
243  CPPUNIT_ASSERT((fabs(pChild->getValue() - 5.23) / 5.23) < 1e-6);
244  CPPUNIT_ASSERT(pChild->getSibling() == NULL);
245 
246  delete pExpanded;
247 }
248 
250  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
251  "<!-- generated with COPASI 4.4.27 (Debug) (http://www.copasi.org) at 2008-08-30 15:28:23 UTC -->\n"
252  "<COPASI xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.copasi.org/static/schema.xsd\" versionMajor=\"1\" versionMinor=\"0\" versionDevel=\"27\">\n"
253  " <ListOfFunctions>\n"
254  " <Function key=\"Function_37\" name=\"function_1\" type=\"UserDefined\" reversible=\"unspecified\">\n"
255  " <Expression>\n"
256  " 3*k\n"
257  " </Expression>\n"
258  " <ListOfParameterDescriptions>\n"
259  " <ParameterDescription key=\"FunctionParameter_260\" name=\"k\" order=\"0\" role=\"variable\"/>\n"
260  " </ListOfParameterDescriptions>\n"
261  " </Function>\n"
262  " <Function key=\"Function_38\" name=\"function_2\" type=\"UserDefined\" reversible=\"unspecified\">\n"
263  " <Expression>\n"
264  " B+A\n"
265  " </Expression>\n"
266  " <ListOfParameterDescriptions>\n"
267  " <ParameterDescription key=\"FunctionParameter_258\" name=\"A\" order=\"0\" role=\"variable\"/>\n"
268  " <ParameterDescription key=\"FunctionParameter_243\" name=\"B\" order=\"1\" role=\"variable\"/>\n"
269  " </ListOfParameterDescriptions>\n"
270  " </Function>\n"
271  " <Function key=\"Function_39\" name=\"function_3\" type=\"UserDefined\" reversible=\"unspecified\">\n"
272  " <Expression>\n"
273  " C-k*1.3\n"
274  " </Expression>\n"
275  " <ListOfParameterDescriptions>\n"
276  " <ParameterDescription key=\"FunctionParameter_246\" name=\"k\" order=\"0\" role=\"variable\"/>\n"
277  " <ParameterDescription key=\"FunctionParameter_250\" name=\"C\" order=\"1\" role=\"variable\"/>\n"
278  " </ListOfParameterDescriptions>\n"
279  " </Function>\n"
280  " <Function key=\"Function_40\" name=\"function_4\" type=\"UserDefined\" reversible=\"unspecified\">\n"
281  " <Expression>\n"
282  " function_2(x,y)/2\n"
283  " </Expression>\n"
284  " <ListOfParameterDescriptions>\n"
285  " <ParameterDescription key=\"FunctionParameter_254\" name=\"x\" order=\"0\" role=\"variable\"/>\n"
286  " <ParameterDescription key=\"FunctionParameter_261\" name=\"y\" order=\"1\" role=\"variable\"/>\n"
287  " </ListOfParameterDescriptions>\n"
288  " </Function>\n"
289  " <Function key=\"Function_41\" name=\"function_5\" type=\"UserDefined\" reversible=\"unspecified\">\n"
290  " <Expression>\n"
291  " function_3(c,a)+(function_1(b)-5.23)\n"
292  " </Expression>\n"
293  " <ListOfParameterDescriptions>\n"
294  " <ParameterDescription key=\"FunctionParameter_262\" name=\"a\" order=\"0\" role=\"variable\"/>\n"
295  " <ParameterDescription key=\"FunctionParameter_263\" name=\"b\" order=\"1\" role=\"variable\"/>\n"
296  " <ParameterDescription key=\"FunctionParameter_264\" name=\"c\" order=\"2\" role=\"variable\"/>\n"
297  " </ListOfParameterDescriptions>\n"
298  " </Function>\n"
299  " <Function key=\"Function_42\" name=\"function_6\" type=\"UserDefined\" reversible=\"unspecified\">\n"
300  " <Expression>\n"
301  " function_5(k1,k2,k3)\n"
302  " </Expression>\n"
303  " <ListOfParameterDescriptions>\n"
304  " <ParameterDescription key=\"FunctionParameter_265\" name=\"k1\" order=\"0\" role=\"variable\"/>\n"
305  " <ParameterDescription key=\"FunctionParameter_266\" name=\"k2\" order=\"1\" role=\"variable\"/>\n"
306  " <ParameterDescription key=\"FunctionParameter_267\" name=\"k3\" order=\"2\" role=\"variable\"/>\n"
307  " </ListOfParameterDescriptions>\n"
308  " </Function>\n"
309  " <!--"
310  " <Function key=\"Function_54\" name=\"Function for reaction1\" type=\"UserDefined\" reversible=\"unspecified\">\n"
311  " <Expression>\n"
312  " 3*parameter_1\n"
313  " </Expression>\n"
314  " <ListOfParameterDescriptions>\n"
315  " <ParameterDescription key=\"FunctionParameter_269\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
316  " </ListOfParameterDescriptions>\n"
317  " </Function>\n"
318  " <Function key=\"Function_55\" name=\"Function for reaction2\" type=\"UserDefined\" reversible=\"unspecified\">\n"
319  " <Expression>\n"
320  " parameter_2+parameter_1\n"
321  " </Expression>\n"
322  " <ListOfParameterDescriptions>\n"
323  " <ParameterDescription key=\"FunctionParameter_272\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
324  " <ParameterDescription key=\"FunctionParameter_273\" name=\"parameter_2\" order=\"1\" role=\"constant\"/>\n"
325  " </ListOfParameterDescriptions>\n"
326  " </Function>\n"
327  " <Function key=\"Function_56\" name=\"Function for reaction3\" type=\"UserDefined\" reversible=\"unspecified\">\n"
328  " <Expression>\n"
329  " species_2-parameter_1*1.3\n"
330  " </Expression>\n"
331  " <ListOfParameterDescriptions>\n"
332  " <ParameterDescription key=\"FunctionParameter_276\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
333  " <ParameterDescription key=\"FunctionParameter_277\" name=\"species_2\" order=\"1\" role=\"product\"/>\n"
334  " </ListOfParameterDescriptions>\n"
335  " </Function>\n"
336  " <Function key=\"Function_57\" name=\"Function for reaction4\" type=\"UserDefined\" reversible=\"true\">\n"
337  " <Expression>\n"
338  " function_2(species_1,species_2)/2\n"
339  " </Expression>\n"
340  " <ListOfParameterDescriptions>\n"
341  " <ParameterDescription key=\"FunctionParameter_280\" name=\"species_1\" order=\"0\" role=\"substrate\"/>\n"
342  " <ParameterDescription key=\"FunctionParameter_281\" name=\"species_2\" order=\"1\" role=\"product\"/>\n"
343  " </ListOfParameterDescriptions>\n"
344  " </Function>\n"
345  " <Function key=\"Function_58\" name=\"Function for reaction5\" type=\"UserDefined\" reversible=\"unspecified\">\n"
346  " <Expression>\n"
347  " function_3(species_2,parameter_1)+(function_1(parameter_3)-5.23)\n"
348  " </Expression>\n"
349  " <ListOfParameterDescriptions>\n"
350  " <ParameterDescription key=\"FunctionParameter_285\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
351  " <ParameterDescription key=\"FunctionParameter_286\" name=\"parameter_3\" order=\"1\" role=\"constant\"/>\n"
352  " <ParameterDescription key=\"FunctionParameter_287\" name=\"species_2\" order=\"2\" role=\"product\"/>\n"
353  " </ListOfParameterDescriptions>\n"
354  " </Function>\n"
355  " <Function key=\"Function_59\" name=\"Function for reaction6\" type=\"UserDefined\" reversible=\"unspecified\">\n"
356  " <Expression>\n"
357  " function_5(parameter_1,parameter_2,parameter_3)\n"
358  " </Expression>\n"
359  " <ListOfParameterDescriptions>\n"
360  " <ParameterDescription key=\"FunctionParameter_291\" name=\"parameter_1\" order=\"0\" role=\"constant\"/>\n"
361  " <ParameterDescription key=\"FunctionParameter_292\" name=\"parameter_2\" order=\"1\" role=\"constant\"/>\n"
362  " <ParameterDescription key=\"FunctionParameter_293\" name=\"parameter_3\" order=\"2\" role=\"constant\"/>\n"
363  " </ListOfParameterDescriptions>\n"
364  " </Function>\n"
365  " -->\n"
366  " </ListOfFunctions>\n"
367  " <!--\n"
368  " <Model key=\"Model_1\" name=\"New Model\" timeUnit=\"s\" volumeUnit=\"l\" quantityUnit=\"mol\" type=\"deterministic\">\n"
369  " <Comment>\n"
370  " <body xmlns=\"http://www.w3.org/1999/xhtml\">\n"
371  " <p>Model with function call in kinetics and rules.</p>\n"
372  " <p>This is to check function expansion for export to L1V2</p>\n"
373  "</body>\n"
374  "\n"
375  " </Comment>\n"
376  " <ListOfCompartments>\n"
377  " <Compartment key=\"Compartment_0\" name=\"compartment\" simulationType=\"fixed\">\n"
378  " </Compartment>\n"
379  " </ListOfCompartments>\n"
380  " <ListOfMetabolites>\n"
381  " <Metabolite key=\"Metabolite_0\" name=\"A\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
382  " </Metabolite>\n"
383  " <Metabolite key=\"Metabolite_1\" name=\"B\" simulationType=\"reactions\" compartment=\"Compartment_0\">\n"
384  " </Metabolite>\n"
385  " <Metabolite key=\"Metabolite_2\" name=\"C\" simulationType=\"assignment\" compartment=\"Compartment_0\">\n"
386  " <Expression>\n"
387  " function_5(&lt;CN=Root,Model=New Model,Vector=Values[K1],Reference=Value&gt;,2.4,3.5)\n"
388  " </Expression>\n"
389  " </Metabolite>\n"
390  " <Metabolite key=\"Metabolite_3\" name=\"D\" simulationType=\"ode\" compartment=\"Compartment_0\">\n"
391  " <Expression>\n"
392  " function_2(&lt;CN=Root,Model=New Model,Vector=Values[K1],Reference=Value&gt;,3.4)\n"
393  " </Expression>\n"
394  " </Metabolite>\n"
395  " <Metabolite key=\"Metabolite_4\" name=\"E\" simulationType=\"ode\" compartment=\"Compartment_0\">\n"
396  " <Expression>\n"
397  " function_4(1.4,&lt;CN=Root,Model=New Model,Vector=Values[K2],Reference=Value&gt;)\n"
398  " </Expression>\n"
399  " </Metabolite>\n"
400  " <Metabolite key=\"Metabolite_5\" name=\"F\" simulationType=\"ode\" compartment=\"Compartment_0\">\n"
401  " <Expression>\n"
402  " function_6(&lt;CN=Root,Model=New Model,Vector=Values[K3],Reference=Value&gt;,&lt;CN=Root,Model=New Model,Vector=Values[K1],Reference=Value&gt;,3.4)\n"
403  " </Expression>\n"
404  " </Metabolite>\n"
405  " </ListOfMetabolites>\n"
406  " <ListOfModelValues>\n"
407  " <ModelValue key=\"ModelValue_0\" name=\"K1\" simulationType=\"assignment\">\n"
408  " <Expression>\n"
409  " function_1(4.5)\n"
410  " </Expression>\n"
411  " </ModelValue>\n"
412  " <ModelValue key=\"ModelValue_1\" name=\"K2\" simulationType=\"fixed\">\n"
413  " </ModelValue>\n"
414  " <ModelValue key=\"ModelValue_2\" name=\"K3\" simulationType=\"assignment\">\n"
415  " <Expression>\n"
416  " function_3(2,&lt;CN=Root,Model=New Model,Vector=Values[K1],Reference=Value&gt;)\n"
417  " </Expression>\n"
418  " </ModelValue>\n"
419  " </ListOfModelValues>\n"
420  " <ListOfReactions>\n"
421  " <Reaction key=\"Reaction_0\" name=\"reaction1\" reversible=\"true\">\n"
422  " <ListOfSubstrates>\n"
423  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
424  " </ListOfSubstrates>\n"
425  " <ListOfProducts>\n"
426  " <Product metabolite=\"Metabolite_1\" stoichiometry=\"1\"/>\n"
427  " </ListOfProducts>\n"
428  " <ListOfConstants>\n"
429  " <Constant key=\"Parameter_81\" name=\"parameter_1\" value=\"1\"/>\n"
430  " </ListOfConstants>\n"
431  " <KineticLaw function=\"Function_54\">\n"
432  " <ListOfCallParameters>\n"
433  " <CallParameter functionParameter=\"FunctionParameter_269\">\n"
434  " <SourceParameter reference=\"ModelValue_0\"/>\n"
435  " </CallParameter>\n"
436  " </ListOfCallParameters>\n"
437  " </KineticLaw>\n"
438  " </Reaction>\n"
439  " <Reaction key=\"Reaction_1\" name=\"reaction2\" reversible=\"true\">\n"
440  " <ListOfSubstrates>\n"
441  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
442  " </ListOfSubstrates>\n"
443  " <ListOfProducts>\n"
444  " <Product metabolite=\"Metabolite_1\" stoichiometry=\"1\"/>\n"
445  " </ListOfProducts>\n"
446  " <ListOfConstants>\n"
447  " <Constant key=\"Parameter_80\" name=\"parameter_1\" value=\"1\"/>\n"
448  " <Constant key=\"Parameter_79\" name=\"parameter_2\" value=\"1\"/>\n"
449  " </ListOfConstants>\n"
450  " <KineticLaw function=\"Function_55\">\n"
451  " <ListOfCallParameters>\n"
452  " <CallParameter functionParameter=\"FunctionParameter_272\">\n"
453  " <SourceParameter reference=\"ModelValue_0\"/>\n"
454  " </CallParameter>\n"
455  " <CallParameter functionParameter=\"FunctionParameter_273\">\n"
456  " <SourceParameter reference=\"ModelValue_1\"/>\n"
457  " </CallParameter>\n"
458  " </ListOfCallParameters>\n"
459  " </KineticLaw>\n"
460  " </Reaction>\n"
461  " <Reaction key=\"Reaction_2\" name=\"reaction3\" reversible=\"true\">\n"
462  " <ListOfSubstrates>\n"
463  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
464  " </ListOfSubstrates>\n"
465  " <ListOfProducts>\n"
466  " <Product metabolite=\"Metabolite_1\" stoichiometry=\"1\"/>\n"
467  " </ListOfProducts>\n"
468  " <ListOfConstants>\n"
469  " <Constant key=\"Parameter_78\" name=\"parameter_1\" value=\"1\"/>\n"
470  " </ListOfConstants>\n"
471  " <KineticLaw function=\"Function_56\">\n"
472  " <ListOfCallParameters>\n"
473  " <CallParameter functionParameter=\"FunctionParameter_276\">\n"
474  " <SourceParameter reference=\"ModelValue_0\"/>\n"
475  " </CallParameter>\n"
476  " <CallParameter functionParameter=\"FunctionParameter_277\">\n"
477  " <SourceParameter reference=\"Metabolite_1\"/>\n"
478  " </CallParameter>\n"
479  " </ListOfCallParameters>\n"
480  " </KineticLaw>\n"
481  " </Reaction>\n"
482  " <Reaction key=\"Reaction_3\" name=\"reaction4\" reversible=\"true\">\n"
483  " <ListOfSubstrates>\n"
484  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
485  " </ListOfSubstrates>\n"
486  " <ListOfProducts>\n"
487  " <Product metabolite=\"Metabolite_1\" stoichiometry=\"1\"/>\n"
488  " </ListOfProducts>\n"
489  " <KineticLaw function=\"Function_57\">\n"
490  " <ListOfCallParameters>\n"
491  " <CallParameter functionParameter=\"FunctionParameter_280\">\n"
492  " <SourceParameter reference=\"Metabolite_0\"/>\n"
493  " </CallParameter>\n"
494  " <CallParameter functionParameter=\"FunctionParameter_281\">\n"
495  " <SourceParameter reference=\"Metabolite_1\"/>\n"
496  " </CallParameter>\n"
497  " </ListOfCallParameters>\n"
498  " </KineticLaw>\n"
499  " </Reaction>\n"
500  " <Reaction key=\"Reaction_4\" name=\"reaction5\" reversible=\"true\">\n"
501  " <ListOfSubstrates>\n"
502  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
503  " </ListOfSubstrates>\n"
504  " <ListOfProducts>\n"
505  " <Product metabolite=\"Metabolite_1\" stoichiometry=\"1\"/>\n"
506  " </ListOfProducts>\n"
507  " <ListOfConstants>\n"
508  " <Constant key=\"Parameter_77\" name=\"parameter_1\" value=\"1\"/>\n"
509  " <Constant key=\"Parameter_76\" name=\"parameter_3\" value=\"1\"/>\n"
510  " </ListOfConstants>\n"
511  " <KineticLaw function=\"Function_58\">\n"
512  " <ListOfCallParameters>\n"
513  " <CallParameter functionParameter=\"FunctionParameter_285\">\n"
514  " <SourceParameter reference=\"ModelValue_0\"/>\n"
515  " </CallParameter>\n"
516  " <CallParameter functionParameter=\"FunctionParameter_286\">\n"
517  " <SourceParameter reference=\"ModelValue_2\"/>\n"
518  " </CallParameter>\n"
519  " <CallParameter functionParameter=\"FunctionParameter_287\">\n"
520  " <SourceParameter reference=\"Metabolite_1\"/>\n"
521  " </CallParameter>\n"
522  " </ListOfCallParameters>\n"
523  " </KineticLaw>\n"
524  " </Reaction>\n"
525  " <Reaction key=\"Reaction_5\" name=\"reaction6\" reversible=\"true\">\n"
526  " <ListOfSubstrates>\n"
527  " <Substrate metabolite=\"Metabolite_0\" stoichiometry=\"1\"/>\n"
528  " </ListOfSubstrates>\n"
529  " <ListOfProducts>\n"
530  " <Product metabolite=\"Metabolite_1\" stoichiometry=\"1\"/>\n"
531  " </ListOfProducts>\n"
532  " <ListOfConstants>\n"
533  " <Constant key=\"Parameter_67\" name=\"parameter_1\" value=\"1\"/>\n"
534  " <Constant key=\"Parameter_68\" name=\"parameter_2\" value=\"1\"/>\n"
535  " <Constant key=\"Parameter_71\" name=\"parameter_3\" value=\"1\"/>\n"
536  " </ListOfConstants>\n"
537  " <KineticLaw function=\"Function_59\">\n"
538  " <ListOfCallParameters>\n"
539  " <CallParameter functionParameter=\"FunctionParameter_291\">\n"
540  " <SourceParameter reference=\"ModelValue_0\"/>\n"
541  " </CallParameter>\n"
542  " <CallParameter functionParameter=\"FunctionParameter_292\">\n"
543  " <SourceParameter reference=\"ModelValue_1\"/>\n"
544  " </CallParameter>\n"
545  " <CallParameter functionParameter=\"FunctionParameter_293\">\n"
546  " <SourceParameter reference=\"ModelValue_2\"/>\n"
547  " </CallParameter>\n"
548  " </ListOfCallParameters>\n"
549  " </KineticLaw>\n"
550  " </Reaction>\n"
551  " </ListOfReactions>\n"
552  " <StateTemplate>\n"
553  " <StateTemplateVariable objectReference=\"Model_1\"/>\n"
554  " <StateTemplateVariable objectReference=\"Metabolite_3\"/>\n"
555  " <StateTemplateVariable objectReference=\"Metabolite_4\"/>\n"
556  " <StateTemplateVariable objectReference=\"Metabolite_5\"/>\n"
557  " <StateTemplateVariable objectReference=\"Metabolite_0\"/>\n"
558  " <StateTemplateVariable objectReference=\"Metabolite_1\"/>\n"
559  " <StateTemplateVariable objectReference=\"Metabolite_2\"/>\n"
560  " <StateTemplateVariable objectReference=\"ModelValue_0\"/>\n"
561  " <StateTemplateVariable objectReference=\"ModelValue_2\"/>\n"
562  " <StateTemplateVariable objectReference=\"ModelValue_1\"/>\n"
563  " <StateTemplateVariable objectReference=\"Compartment_0\"/>\n"
564  " </StateTemplate>\n"
565  " <InitialState type=\"initialState\">\n"
566  " 0 6.0221415e+23 6.0221415e+23 6.0221415e+23 6.0221415e+23 6.0221415e+23 6.0221415e+23 1.1 1.3 1.2 1\n"
567  " </InitialState>\n"
568  " </Model>\n"
569  " -->\n"
570  "</COPASI>\n"
571  ;
virtual bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
const std::string & getObjectName() const
const Type & getType() const
bool load_cps_model_from_stream(std::istream &is, CCopasiDataModel &dataModel)
Definition: utilities.cpp:21
static Type type(const Type &type)
static CCopasiDataModel * pCOPASIDATAMODEL
static const char * MODEL_STRING1
static CFunctionDB * getFunctionList()
static CCopasiDataModel * addDatamodel()
static Type subType(const Type &type)
The class for handling a chemical kinetic function.
Definition: CFunction.h:29
static void init(int argc, char *argv[], const bool &withGui=false)
virtual const Data & getData() const
Definition: CCopasiNode.h:118
ASTNode * expand_function_calls(const ASTNode *pNode, const ListOfFunctionDefinitions *pFunctions)
CCopasiNode< Data > * getChild()
Definition: CCopasiNode.h:210
CFunction * findFunction(const std::string &functionName)
CFunctionParameters & getVariables()
Definition: CFunction.cpp:148