9 |
int main(void){ |
int main(void){ |
10 |
|
|
11 |
Library L; |
Library L; |
12 |
L.load("test/ipopt/test1.a4c"); |
L.load("test/ipopt/test2.a4c"); |
13 |
Type t = L.findType("test1"); |
Type t = L.findType("test2"); |
|
cerr << "Type = " << t.getName() << endl; |
|
14 |
Simulation S = t.getSimulation("S"); |
Simulation S = t.getSimulation("S"); |
|
|
|
|
S.build(); |
|
|
|
|
|
cerr << "About to solve..." << endl; |
|
|
S.run(t.getMethod("bound_self")); |
|
|
S.run(t.getMethod("default_self")); |
|
15 |
SolverReporter R; |
SolverReporter R; |
16 |
S.solve(Solver("IPOPT"),R); |
try{ |
17 |
|
S.solve(Solver("IPOPT"),R); |
18 |
|
}catch(runtime_error &e){ |
19 |
|
cerr << "ERROR in solving:" << e.what() << endl; |
20 |
|
exit(1); |
21 |
|
} |
22 |
S.run(t.getMethod("self_test")); |
S.run(t.getMethod("self_test")); |
23 |
} |
} |