1 |
#include "library.h" |
2 |
#include "simulation.h" |
3 |
#include "solver.h" |
4 |
#include "solverreporter.h" |
5 |
#include "solverhooks.h" |
6 |
|
7 |
#include <iostream> |
8 |
using namespace std; |
9 |
|
10 |
int main(void){ |
11 |
SolverReporter R; // contains methods to report solver progress; |
12 |
SolverHooks H(&R); // hooks slvreq into Simulation |
13 |
SolverHooksManager::Instance()->setHooks(&H); // register our SolverHooks |
14 |
|
15 |
Library L; |
16 |
L.load("test/slvreq/test2.a4c"); |
17 |
Type t = L.findType("test2"); |
18 |
|
19 |
// in here, there is a call to slvreq_assign_hooks. |
20 |
Simulation S = t.getSimulation("S",1); |
21 |
|
22 |
Method M = t.getMethod("on_load"); |
23 |
S.run(M); |
24 |
|
25 |
CONSOLE_DEBUG("Completed OK"); |
26 |
// the test1 model contains SOLVE command, so the output will now show that |
27 |
// the requested model has been solved. |
28 |
} |