This example demonstrates how to solve a simple GAMS model to assign stores to warehouses for different data sets in parallel. More...
Go to the source code of this file.
Functions | |
def | warehouse.solve_warehouse (workspace, nr_warehouses, result, lock) |
Variables | |
str | warehouse.GAMS_MODEL |
sys | warehouse.sys_dir = sys.argv[1] if len(sys.argv) > 1 else None |
GamsWorkspace | warehouse.ws = GamsWorkspace(system_directory=sys_dir) |
GamsWorkspace | warehouse.result_db = ws.add_database() |
str | warehouse.status_string = "" |
int | warehouse.status = 0 |
Lock | warehouse.lock = Lock() |
list | warehouse.threads = [] |
Thread | warehouse.t = Thread(target=solve_warehouse, args=(ws, i, result_db, lock)) |
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.py.