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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations) (download) (as text)
Fri Feb 24 06:05:10 2006 UTC (18 years, 4 months ago) by johnpye
File MIME type: text/x-chdr
File size: 2481 byte(s)
Added ability to output variables at bounds (currently just to the console).
Changed solver parameters window into a proper 'dialog'.
Various fixes to make dialogs focus and position correctly.
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 #ifndef ASCEND_INCDIR
26 #define ASCEND_INCDIR "/home/john/src/ascend/trunk/base/generic/lib"
27 #endif
28 #ifndef ASCEND_LIBDIR
29 #define ASCEND_LIBDIR "/home/john/src/ascend/trunk/base/jam/Release/linux"
30 #endif
31 #ifndef ASCEND_TMPDIR
32 #define ASCEND_TMPDIR "/tmp"
33 #endif
34 #ifndef ASCEND_MAKEFILEDIR
35 #define ASCEND_MAKEFILEDIR_1 "/home/john/src/ascend/trunk/pygtk/interface"
36 #define ASCEND_MAKEFILEDIR "/home/john/src/ascend/trunk/base/generic/lib"
37 #endif
38
39 /**
40 @TODO This class is for *Simulation* instances.
41
42 Handle instantiating, running initialisation functions, solving
43 and outputing results of solutions.
44
45 In ASCEND C-code, a simulation is a special type of Instance. It
46 has a 'simulation root' instance which often needs to be used for
47 solving, inspecting, etc, rather than the simulation instance itself.
48 */
49 class Simulation : public Instanc{
50 friend class IncidenceMatrix;
51 friend class SolverStatus;
52
53 private:
54 Instanc simroot;
55 slv_system_structure *sys;
56 bool is_built;
57
58 // options to pass to BinTokenSetOptions
59 /// TODO these should probably be put somewhere else
60 std::string *bin_srcname;
61 std::string *bin_objname;
62 std::string *bin_libname;
63 std::string *bin_cmd;
64 std::string *bin_rm;
65
66 int activeblock;
67
68 protected:
69 slv_system_structure *getSystem();
70
71 public:
72 explicit Simulation(Instance *i, const SymChar &name);
73 Simulation(const Simulation &);
74 ~Simulation();
75
76 Instanc &getModel();
77 void run(const Method &method);
78 void checkDoF() const;
79 const bool check();
80 void build();
81 void solve(Solver s, SolverReporter &reporter);
82 std::vector<Variable> getFixableVariables();
83 std::vector<Variable> getVariablesNearBounds(const double &epsilon=1e-4);
84
85 void write();
86
87 void setSolver(Solver &s);
88 const Solver getSolver() const;
89
90 SolverParameters getSolverParameters() const;
91 void setSolverParameters(SolverParameters &);
92
93 IncidenceMatrix getIncidenceMatrix();
94
95 const std::string getInstanceName(const Instanc &) const;
96
97 void processVarStatus();
98 const int getNumVars();
99
100 const int getActiveBlock() const;
101
102 void checkConsistency() const;
103 void checkStructuralSingularity() const;
104 };
105
106
107 #endif

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