GAMS 中的字符串变量
String variables in GAMS
如何在 GAMS 中定义字符串变量。我想将其用作包含文件的参考,如下所示
set file = "myfile.inc"; (i have no idea how to do this part)
$include file;
代替
$include "myfile.inc"
$设置文件file_name_here
$include %file%.inc
文件正在替换为您想要的文件名。
请注意,如果您也想在其他包含的文件中使用此字符串变量,则必须使用 $setglobal 而不是 $set
如何在 GAMS 中定义字符串变量。我想将其用作包含文件的参考,如下所示
set file = "myfile.inc"; (i have no idea how to do this part)
$include file;
代替
$include "myfile.inc"
$设置文件file_name_here
$include %file%.inc
文件正在替换为您想要的文件名。 请注意,如果您也想在其他包含的文件中使用此字符串变量,则必须使用 $setglobal 而不是 $set