Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试解决数学优化模型。我想在我的模型中定义一个集合,比如说,我希望它是从 0 到 15。这可能吗?或者我必须定义从 1 到 16?我正在使用网站上提供的 GAMS(通用代数建模系统)演示版。
谢谢
PS:请有足够声誉的人创建一个GAMS标签!
如果您愿意,您可以定义从 0 到 15 的集合。例如,
set i 'plants' /i0*i9/ parameter a(i); a(i)=uniformint(1,9); display a;
这是结果,
PARAMETER a i0 2.000, i1 8.000, i2 5.000, i3 3.000, i4 3.000, i5 3.000 i6 4.000, i7 8.000, i8 1.000, i9 5.000
希望有帮助。索菲亚