GET A QUOTE
SEARCH
Products
GAMS - The Modeling Language
GAMS MIRO
GAMS Engine
GAMSPy
Documentation
GAMS
MIRO
Engine
GAMSPy
Academics
Download
GAMS
MIRO
Engine
GAMSPy
Consulting
Support
Community
Sign-up for our Newsletter
Case Studies
The GAMS Forum
Meet us at a Conference
Read our GAMS Blog
Visit a GAMS Webinar
Take a GAMS Course
About Us
Company Information
The GAMS team
Career
Openings
Internships
Advisory Board
Information Security
Search
×
Search
Case sensitive
Match whole word
GAMS Documentation
Model Library
MIRO Documentation
ENGINE Documentation
Website & Blog
All
User's Guide
Solvers
Tools
APIs
Release Notes
All
Model
Test
Data
EMP
API
FIN
NOA
PSOPT
50 (latest)
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25.1
Version:
Documentation
Preface
Release Notes
Installation and Licensing
Tutorials and Examples
GAMS Language and Environment
Solver Manuals
Tools Manuals
Application Programming Interfaces
Glossary
Bibliograhpy
Model Libraries
GAMS Model Library
GAMS Test Library
GAMS Data Library
GAMS EMP Library
GAMS API Library
FIN Library
NOA Library
PSOPT Library
Index
Help
Hide Table of Contents
Loading...
Searching...
No Matches
transport14
transport14.cpp
Go to the documentation of this file.
1
25
#include "
optimizer.h
"
26
27
#include <iostream>
28
#include <thread>
29
30
using namespace
gams
;
31
using namespace
std;
32
33
void
run
(
Optimizer
optim,
double
bmult)
34
{
35
cout <<
"Scenario bmult="
<< bmult <<
", Obj:"
<< optim.
solve
(bmult) << endl;
36
}
37
43
int
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
}
Optimizer
Definition
optimizer.h:35
Optimizer::solve
double solve(double mult)
Create database and execute a job.
Definition
optimizer.cpp:43
gams::GAMSException
gams
optimizer.h
Wrapper class definition for executing transport14.
main
int main(int argc, char *argv[])
Definition
transport14.cpp:43
run
void run(Optimizer optim, double bmult)
Definition
transport14.cpp:33