I would like to run two models iteratively and exchange parameters between them, which should be modified in Excel in between runs. I use GAMS Connect to communicate between GAMS and Excel.
The problem is, when importing from Excel, only the base parameter-value is imported (and not the updated value for each iteration). When I open the Excel file after having the model run, I see the parameter value of the last iteration, so I guess the problem is caused by the importing.
Is there maybe a simple solution/workaround to this? Otherwise, of course, one solution would be to get rid of Excel completely and do all the transformations in GAMS as well.
Many thanks!
Jonas
Here is a simple example of the embedded code I use for the export and import (here without any transformation in between).
Code: Select all
EmbeddedCode Connect:
- GAMSReader:
symbols:
- name: qwati
- PandasExcelWriter:
trace: 3
file: test/data.xlsx
symbols:
- name: qwati
range: qwati!A1
endEmbeddedCode
$onEmbeddedCode Connect:
- PandasExcelReader:
file: test/data.xlsx
symbols:
- name: qwat_mod
rowDimension: 0
columnDimension: 0
range: qwati!A1
- GAMSWriter:
writeAll: True
$offEmbeddedCode