如何减小GAMS生成的.lst文件

2020-02-13  本文已影响0人  柯西盗耳

在使用GAMS求解优化问题时,它会自动生成.lst文件,即列表文件,其中包含了带行号的源代码、优化模型的所有变量和方程以及求解出的变量和方程结果等等。如果优化模型比较复杂造成变量和约束条件很多,那么生成的默认lst文件也会很大,单次可能多达几百兆或者上G,如果有循环的话,其累计大小更是不可估量。这会增加求解过程中对计算机硬盘资源占用和频繁访问,降低求解效率。

本文讲解当你不需要浏览或保存lst文件时,如何通过调整参数和选项来显著压缩lst文件的大小,使其可以忽略不计。

* Turn off the listing of the input file

$offlisting

* Turn off the listing and cross-reference of the symbols used

$offsymxref

$offsymlist

* equations listed per block

option limrow = 0;

* variables listed per block 

option limcol = 0;

* solver's solution output printed

option solprint = off;

* solver's system output printed

option sysout = off;

上一篇 下一篇

猜你喜欢

热点阅读