Loading...
Searching...
No Matches
transport14.cpp
Go to the documentation of this file.
1
25#include "optimizer.h"
26
27#include <iostream>
28#include <thread>
29
30using namespace gams;
31using namespace std;
32
33void run(Optimizer optim, double bmult)
34{
35 cout << "Scenario bmult=" << bmult << ", Obj:" << optim.solve(bmult) << endl;
36}
37
43int main(int argc, char* argv[])
44{
45 cout << "---------- Transport 14 --------------" << endl;
46
47 try {
48 vector<double> bmultlist { 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3 };
49 const Optimizer &optim = Optimizer(argc, argv);
50
51 vector<thread> threads;
52 for (auto bmult : bmultlist)
53 threads.push_back(thread(run, optim, bmult));
54
55 for (auto& t : threads)
56 t.join();
57
58 } catch (GAMSException &ex) {
59 cout << "GAMSException occured: " << ex.what() << endl;
60 } catch (exception &ex) {
61 cout << ex.what() << endl;
62 }
63
64 return 0;
65}
Wrapper class definition for executing transport14.