/[ascend]/trunk/pygtk/interface/simulation.h
ViewVC logotype

Contents of /trunk/pygtk/interface/simulation.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 285 - (show annotations) (download) (as text)
Thu Feb 9 04:21:30 2006 UTC (18 years, 4 months ago) by johnpye
File MIME type: text/x-chdr
File size: 2210 byte(s)
Colours fixed, zooming works, active block focussed by default.
1 #ifndef ASCXX_SIMULATION_H
2 #define ASCXX_SIMULATION_H
3
4 #include <string>
5 #include <vector>
6 #include <map>
7
8 #include "symchar.h"
9 #include "type.h"
10 #include "instance.h"
11
12 class Variable;
13
14 extern "C"{
15 #include <compiler/createinst.h>
16 #include <solver/slv_types.h>
17 }
18
19 class Solver;
20 class SolverParameters;
21 class IncidenceMatrix;
22
23 #ifndef ASCEND_INCDIR
24 #define ASCEND_INCDIR "/home/john/src/ascend/trunk/base/generic/lib"
25 #endif
26 #ifndef ASCEND_LIBDIR
27 #define ASCEND_LIBDIR "/home/john/src/ascend/trunk/base/jam/Release/linux"
28 #endif
29 #ifndef ASCEND_TMPDIR
30 #define ASCEND_TMPDIR "/tmp"
31 #endif
32 #ifndef ASCEND_MAKEFILEDIR
33 #define ASCEND_MAKEFILEDIR_1 "/home/john/src/ascend/trunk/pygtk/interface"
34 #define ASCEND_MAKEFILEDIR "/home/john/src/ascend/trunk/base/generic/lib"
35 #endif
36
37 /**
38 @TODO This class is for *Simulation* instances.
39
40 Handle instantiating, running initialisation functions, solving
41 and outputing results of solutions.
42
43 In ASCEND C-code, a simulation is a special type of Instance. It
44 has a 'simulation root' instance which often needs to be used for
45 solving, inspecting, etc, rather than the simulation instance itself.
46 */
47 class Simulation : public Instanc{
48 friend class IncidenceMatrix;
49
50 private:
51 Instanc simroot;
52 slv_system_structure *sys;
53 bool is_built;
54
55 // options to pass to BinTokenSetOptions
56 /// TODO these should probably be put somewhere else
57 std::string *bin_srcname;
58 std::string *bin_objname;
59 std::string *bin_libname;
60 std::string *bin_cmd;
61 std::string *bin_rm;
62
63 int activeblock;
64
65 protected:
66 slv_system_structure *getSystem();
67
68 public:
69 explicit Simulation(Instance *i, const SymChar &name);
70 Simulation(const Simulation &);
71 ~Simulation();
72
73 Instanc &getModel();
74 void run(const Method &method);
75 void checkDoF() const;
76 const bool check();
77 void build();
78 void solve(Solver s);
79 std::vector<Variable> getFixableVariables();
80 void write();
81
82 void setSolver(Solver &s);
83 const Solver getSolver() const;
84
85 SolverParameters getSolverParameters() const;
86 void setSolverParameters(SolverParameters &);
87
88 IncidenceMatrix getIncidenceMatrix();
89
90 const std::string getInstanceName(const Instanc &) const;
91
92 void processVarStatus();
93
94 const int getActiveBlock() const;
95
96 };
97
98
99 #endif

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22