4 |
#include <string> |
#include <string> |
5 |
#include <vector> |
#include <vector> |
6 |
|
|
7 |
|
|
8 |
#include "symchar.h" |
#include "symchar.h" |
9 |
#include "type.h" |
#include "type.h" |
10 |
#include "instance.h" |
#include "instance.h" |
32 |
#endif |
#endif |
33 |
|
|
34 |
/** |
/** |
35 |
@TOD This class is for *Simulation* instances. |
@TODO This class is for *Simulation* instances. |
36 |
|
|
37 |
Handle instantiating, running initialisation functions, solving |
Handle instantiating, running initialisation functions, solving |
38 |
and outputing results of solutions. |
and outputing results of solutions. |
39 |
|
|
|
This class has to be called 'Instanc' in C++ to avoid a name clash |
|
|
with C. Maybe coulda done it with namespaces but didn't know how. |
|
|
|
|
|
This class is renamed back to 'Instance' by SWIG, so use 'Instance' |
|
|
when you're in Python. |
|
|
|
|
40 |
In ASCEND C-code, a simulation is a special type of Instance. It |
In ASCEND C-code, a simulation is a special type of Instance. It |
41 |
has a 'simulation root' instance which often needs to be used for |
has a 'simulation root' instance which often needs to be used for |
42 |
solving, inspecting, etc, rather than the simulation instance itself. |
solving, inspecting, etc, rather than the simulation instance itself. |
44 |
class Simulation : public Instanc{ |
class Simulation : public Instanc{ |
45 |
private: |
private: |
46 |
Instanc simroot; |
Instanc simroot; |
47 |
slv_system_t sys; |
slv_system_structure *sys; |
48 |
bool is_built; |
bool is_built; |
49 |
|
|
50 |
// options to pass to BinTokenSetOptions |
// options to pass to BinTokenSetOptions |
51 |
|
/// TODO these should probably be put somewhere else |
52 |
std::string *bin_srcname; |
std::string *bin_srcname; |
53 |
std::string *bin_objname; |
std::string *bin_objname; |
54 |
std::string *bin_libname; |
std::string *bin_libname; |
56 |
std::string *bin_rm; |
std::string *bin_rm; |
57 |
|
|
58 |
public: |
public: |
59 |
Simulation(Instance *i, const SymChar &name); |
explicit Simulation(Instance *i, const SymChar &name); |
60 |
|
Simulation(const Simulation &); |
61 |
|
~Simulation(); |
62 |
|
|
63 |
Instanc &getModel(); |
Instanc &getModel(); |
64 |
void run(const Method &method); |
void run(const Method &method); |
65 |
void checkDoF() const; |
void checkDoF() const; |