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

Contents of /trunk/pygtk/simulation.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download) (as text)
Mon Apr 24 02:23:08 2006 UTC (14 years, 1 month ago) by johnpye
File MIME type: text/x-chdr
File size: 2056 byte(s)
Removed 'interface' directory in trunk/pygtk/interface (moved everything up a level)
Made corresponding changes to SCons* and spec 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 #include "config.h"
15 extern "C"{
16 #include <compiler/createinst.h>
17 #include <solver/slv_types.h>
18 }
19
20 class Solver;
21 class SolverParameters;
22 class SolverStatus;
23 class IncidenceMatrix;
24 class SolverReporter;
25
26 /**
27 @TODO This class is for *Simulation* instances.
28
29 Handle instantiating, running initialisation functions, solving
30 and outputing results of solutions.
31
32 In ASCEND C-code, a simulation is a special type of Instance. It
33 has a 'simulation root' instance which often needs to be used for
34 solving, inspecting, etc, rather than the simulation instance itself.
35 */
36 class Simulation : public Instanc{
37 friend class IncidenceMatrix;
38 friend class SolverStatus;
39
40 private:
41 Instanc simroot;
42 slv_system_structure *sys;
43 bool is_built;
44
45 // options to pass to BinTokenSetOptions
46 /// TODO these should probably be put somewhere else
47 std::string *bin_srcname;
48 std::string *bin_objname;
49 std::string *bin_libname;
50 std::string *bin_cmd;
51 std::string *bin_rm;
52
53 int activeblock;
54
55 protected:
56 slv_system_structure *getSystem();
57
58 public:
59 explicit Simulation(Instance *i, const SymChar &name);
60 Simulation(const Simulation &);
61 ~Simulation();
62
63 Instanc &getModel();
64 void run(const Method &method);
65 void checkDoF() const;
66 const bool check();
67 void build();
68 void solve(Solver s, SolverReporter &reporter);
69 std::vector<Variable> getFixableVariables();
70 std::vector<Variable> getVariablesNearBounds(const double &epsilon=1e-4);
71
72 void write();
73
74 void setSolver(Solver &s);
75 const Solver getSolver() const;
76
77 SolverParameters getSolverParameters() const;
78 void setSolverParameters(SolverParameters &);
79
80 IncidenceMatrix getIncidenceMatrix();
81
82 const std::string getInstanceName(const Instanc &) const;
83
84 void processVarStatus();
85 const int getNumVars();
86
87 const int getActiveBlock() const;
88
89 void checkConsistency() const;
90 void checkStructuralSingularity() const;
91 };
92
93
94 #endif

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