libutap
sbmlconverter.h
Go to the documentation of this file.
1 // -*- mode: C++; c-file-style: "stroustrup"; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 
3 /* libutap - Uppaal Timed Automata Parser.
4  Copyright (C) 2002-2006 Uppsala University and Aalborg University.
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public License
8  as published by the Free Software Foundation; either version 2.1 of
9  the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  USA
20  */
21 
22 #ifndef SBMLREADER_H
23 #define SBMLREADER_H
24 
25 #include "utap/builder.h"
26 #include "utap/systembuilder.h"
27 #include "utap/SBMLtoXMLWriter.h"
28 #include <sbml/SBMLTypes.h>
29 #include <sbml/Model.h>
30 #include <sbml/math/ASTNode.h>
31 #include <libxml/xmlwriter.h>
32 #include <libxml/xmlreader.h>
33 
34 #include <vector>
35 #include <boost/unordered_map.hpp>
36 
37 #define x0 -256
38 #define y0 -320
39 #define x1 -192
40 #define y1 -128
41 
42 namespace UTAP
43 {
44 
46 public:
47  SBMLConverter(xmlTextReaderPtr reader);
48  void convertIntoXML();
49  virtual ~SBMLConverter();
50 private:
51  // infrastructure
52  Model * model;
53  xmlTextReaderPtr reader;
54  const char * filename;
55  SBMLtoXMLWriter * bigWriter;
57  // model information
58  boost::unordered_map<int,boost::unordered_map<std::string,int> > change;
59  boost::unordered_map<std::string,double> params;
60 
61  // declaration content to be written
62  std::string paramsToWrite;
63  std::string arrayOfSpecies;
64  std::string arrayOfRates;
65  std::string arrayOfChange;
66  std::string functions;
67 
68  void initDocument();
69  void declare();
70  void build();
71  void endDocument();
72  void writeDeclarations();
73  void getParams();
74  double computeParam(const ASTNode *);
75  void declareSpecies();
76  void declareReactions();
77  void declareChange();
78  void propensity();
79  void createUpdateFunction();
80  void createReactionState(int);
81  void createReactionTransition(int);
82  bool listContains(ListOf *, std::string);
83 };
84 
85 }
86 #endif /* SBMLREADER_H */
Definition: SBMLtoXMLWriter.h:27
virtual ~SBMLConverter()
Definition: sbmlconverter.h:45
Definition: lexer.cc:585
SBMLConverter(xmlTextReaderPtr reader)