全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
1672 4
2013-10-29
大家有谁现在在学gams呀? 我正在学习,大家可以一起学习交流,我的qq是751501242,也可以用qq交流,
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-10-30 13:13:13
人不猥琐枉少年!!!!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-11-1 07:53:51
monsterll 发表于 2013-10-30 13:13
人不猥琐枉少年!!!!!!
人家是真的在学,有不懂得想有个人探讨一下,看来你从思想上就不健康.........
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-2-8 20:23:25
GAMS就是只用把模型建好,然后自动进行各种规划,而不用关心具体的细节,只用知道几个算法的大概内容就行了,一个典型的GAMS程序如下所示,这个是GAMS介绍用的。

*集合变量
Sets
i canning plants / seattle, san-diego /
j markets / new-york, chicago, topeka / ;
*参数
Parameters
a(i) capacity of plant i in cases
/ seattle 350
san-diego 600 /
b(j) demand at market j in cases
/ new-york 325
chicago 300
topeka 275 / ;

*基本数据表格,注意表格输入,表头要有几个空格,否则会提示行不正确,汗
Table d(i,j) distance in thousands of miles
          new-york chicago topeka
seattle   2.5        1.7    1.8
san-diego 2.5        1.8    1.4;
*标度,这个好像意义不大
Scalar f freight in dollars per case per thousand miles /90/;
*参数
Parameter c(i,j) transport cost in thousands of dollars per case ;
c(i,j) = f * d(i,j) / 1000 ;

*变量
Variables
x(i,j) shipment quantities in cases
z total transportation costs in thousands of dollars ;
Positive Variable x ;

*等式 ,相当于约束条件,可以为等式或者不等式
Equations
cost define objective function
supply(i) observe supply limit at plant i
demand(j) satisfy demand at market j ;
cost .. z =e= sum((i,j), c(i,j)*x(i,j)) ;
supply(i) .. sum(j, x(i,j)) =l= a(i) ;
demand(j) .. sum(i, x(i,j)) =g= b(j) ;
Model transport /all/ ;
Solve transport using lp minimizing z ;
Display x.l, x.m ;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-2-8 20:26:58
matlab-007 发表于 2015-2-8 20:23
GAMS就是只用把模型建好,然后自动进行各种规划,而不用关心具体的细节,只用知道几个算法的大概内容就行了 ...
多谢。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群