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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 337 - (hide annotations) (download) (as text)
Wed Mar 1 00:51:23 2006 UTC (18 years, 4 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 johnpye 132 #ifndef ASCXX_SIMULATION_H
2     #define ASCXX_SIMULATION_H
3    
4     #include <string>
5     #include <vector>
6 johnpye 255 #include <map>
7 johnpye 132
8     #include "symchar.h"
9     #include "type.h"
10     #include "instance.h"
11    
12 johnpye 237 class Variable;
13    
14 johnpye 132 extern "C"{
15     #include <compiler/createinst.h>
16     #include <solver/slv_types.h>
17     }
18    
19     class Solver;
20 johnpye 208 class SolverParameters;
21 johnpye 307 class SolverStatus;
22 johnpye 233 class IncidenceMatrix;
23 johnpye 310 class SolverReporter;
24 johnpye 132
25 johnpye 337 #include "config.h"
26 johnpye 132
27     /**
28 johnpye 164 @TODO This class is for *Simulation* instances.
29 johnpye 132
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 johnpye 233 friend class IncidenceMatrix;
39 johnpye 307 friend class SolverStatus;
40 johnpye 233
41 johnpye 132 private:
42     Instanc simroot;
43 johnpye 164 slv_system_structure *sys;
44 johnpye 153 bool is_built;
45 johnpye 132
46     // options to pass to BinTokenSetOptions
47 johnpye 164 /// TODO these should probably be put somewhere else
48 johnpye 132 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 johnpye 285 int activeblock;
55    
56 johnpye 233 protected:
57     slv_system_structure *getSystem();
58 johnpye 337
59 johnpye 132 public:
60 johnpye 164 explicit Simulation(Instance *i, const SymChar &name);
61     Simulation(const Simulation &);
62     ~Simulation();
63    
64 johnpye 132 Instanc &getModel();
65     void run(const Method &method);
66     void checkDoF() const;
67     const bool check();
68     void build();
69 johnpye 310 void solve(Solver s, SolverReporter &reporter);
70 johnpye 132 std::vector<Variable> getFixableVariables();
71 johnpye 328 std::vector<Variable> getVariablesNearBounds(const double &epsilon=1e-4);
72    
73 johnpye 132 void write();
74    
75     void setSolver(Solver &s);
76     const Solver getSolver() const;
77 johnpye 196
78 johnpye 208 SolverParameters getSolverParameters() const;
79 johnpye 225 void setSolverParameters(SolverParameters &);
80 johnpye 233
81     IncidenceMatrix getIncidenceMatrix();
82 johnpye 252
83     const std::string getInstanceName(const Instanc &) const;
84 johnpye 255
85     void processVarStatus();
86 johnpye 317 const int getNumVars();
87 johnpye 283
88 johnpye 285 const int getActiveBlock() const;
89    
90 johnpye 295 void checkConsistency() const;
91     void checkStructuralSingularity() const;
92 johnpye 132 };
93    
94    
95     #endif

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