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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 337 - (show annotations) (download) (as text)
Wed Mar 1 00:51:23 2006 UTC (18 years, 3 months ago) by johnpye
File MIME type: text/x-chdr
File size: 2057 byte(s)
Something is starting to run on MinGW now. GUI loads and ascend DLL is opened.
This revision still breaks the linux and Tcl/Tk builds, I expect.
Also added some smarts to the 'help...contents' menu for loading offline/online help files.
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 SolverStatus;
22 class IncidenceMatrix;
23 class SolverReporter;
24
25 #include "config.h"
26
27 /**
28 @TODO This class is for *Simulation* instances.
29
30 Handle instantiating, running initialisation functions, solving
31 and outputing results of solutions.
32
33 In ASCEND C-code, a simulation is a special type of Instance. It
34 has a 'simulation root' instance which often needs to be used for
35 solving, inspecting, etc, rather than the simulation instance itself.
36 */
37 class Simulation : public Instanc{
38 friend class IncidenceMatrix;
39 friend class SolverStatus;
40
41 private:
42 Instanc simroot;
43 slv_system_structure *sys;
44 bool is_built;
45
46 // options to pass to BinTokenSetOptions
47 /// TODO these should probably be put somewhere else
48 std::string *bin_srcname;
49 std::string *bin_objname;
50 std::string *bin_libname;
51 std::string *bin_cmd;
52 std::string *bin_rm;
53
54 int activeblock;
55
56 protected:
57 slv_system_structure *getSystem();
58
59 public:
60 explicit Simulation(Instance *i, const SymChar &name);
61 Simulation(const Simulation &);
62 ~Simulation();
63
64 Instanc &getModel();
65 void run(const Method &method);
66 void checkDoF() const;
67 const bool check();
68 void build();
69 void solve(Solver s, SolverReporter &reporter);
70 std::vector<Variable> getFixableVariables();
71 std::vector<Variable> getVariablesNearBounds(const double &epsilon=1e-4);
72
73 void write();
74
75 void setSolver(Solver &s);
76 const Solver getSolver() const;
77
78 SolverParameters getSolverParameters() const;
79 void setSolverParameters(SolverParameters &);
80
81 IncidenceMatrix getIncidenceMatrix();
82
83 const std::string getInstanceName(const Instanc &) const;
84
85 void processVarStatus();
86 const int getNumVars();
87
88 const int getActiveBlock() const;
89
90 void checkConsistency() const;
91 void checkStructuralSingularity() const;
92 };
93
94
95 #endif

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