This example demonstrates how to solve a simple GAMS model to assign stores to warehouses for different data sets in parallel. More...
#include <iostream>#include <fstream>#include <mutex>#include <thread>#include "gams.h"Go to the source code of this file.
Functions | |
| string | getModelText () |
| Get model as string. | |
| void | solveWarehouse (GAMSWorkspace *ws, int numberOfWarehouses, GAMSDatabase *resultDB, mutex *dbMutex) |
| int | main (int argc, char *argv[]) |
Detailed Description
This example demonstrates how to solve a simple GAMS model to assign stores to warehouses for different data sets in parallel.
The model has been parameterized. The data can be derived from a few numbers namely the number of warehouses, stores, and some fixed cost scalar. The results of the model are written into a single result database that is protected across the parallel threads via a mutex.
Definition in file warehouse.cpp.
Function Documentation
◆ getModelText()
| string getModelText | ( | ) |
Get model as string.
Definition at line 38 of file warehouse.cpp.
Referenced by solveWarehouse().
◆ main()
| int main | ( | int | argc, |
| char * | argv[] ) |
Definition at line 175 of file warehouse.cpp.
◆ solveWarehouse()
| void solveWarehouse | ( | GAMSWorkspace * | ws, |
| int | numberOfWarehouses, | ||
| GAMSDatabase * | resultDB, | ||
| mutex * | dbMutex ) |
Definition at line 110 of file warehouse.cpp.