Sylvain MOS
luyued 发布于 2011-03-21 20:18 浏览 N 次parameter nr(r);
loop(r, nr(r) = sum((i,v)$(IN(v,r) or OUT(v,r)), Z.l(i,v)););
display nr;
* to estimate minimal number of slots
u1=milpnlp u2=LeeCrudeOil1.gms u3=7 mip=cplex nlp=snopt
u3=7 number of slots
r1 1.000, r2 1.000, r3 4.000, r4 5.000, r5 5.000, r6 5.000
r7 3.000
u3=5
r1 1.000, r2 1.000, r3 4.000, r4 5.000, r5 5.000, r6 5.000
r7 3.000
u3=6
r1 1.000, r2 1.000, r3 5.000, r4 4.000, r5 5.000, r6 5.000
r7 3.000
u3=8
r1 1.000, r2 1.000, r3 4.000, r4 5.000, r5 5.000, r6 5.000
r7 3.000
u3=9
r1 1.000, r2 1.000, r3 4.000, r4 5.000, r5 5.000, r6 5.000
r7 3.000
----------------------------------------------------------------------------------------------------------------
$ONEMPTY
$ONUELLIST
*** Sets declaration
Sets
i slots / i1*i%gams.user3% /
v operations
p products z
r inventory resources
k properties
vs sets of operations
;
Alias (i,j,i1,i2);
Alias (v,w,v1,v2);
Alias (vs,vs1,vs2,vs3);
Sets
ORD2(i,j) ordered slots (i <= j)
VSET(vs,v) sets of operations membership
CLIQUE(vs) clique sets
CLIQUE2(v,w) clique sets of two operations
SETREQPREC1(vs)
SETREQPREC1ANTECEDENT(vs,v)
SETREQPREC1SUBSEQUENT(vs,v)
IN(v,r) inventory inlet operations
OUT(v,r) inventory outlet operations
;
*** Parameters declaration
Parameters
H
minS(v)
maxS(v)
minD(v)
maxD(v)
minE(v)
maxE(v)
minVT(v)
maxVT(v)
minB(v)
maxB(v)
minCT(r)
maxCT(r)
iniCT(r)
iniCP(r,p)
minFR(v)
maxFR(v)
totD(vs)
minDem(vs)
maxDem(vs)
val(v,p)
prop(p,k)
minProp(v,k)
maxProp(v,k)
maxE(v)
minN(vs)
maxN(vs)
minN1(vs)
maxN1(vs)
;
*** Variables declaration
Variable OBJ;
Binary Variable Z(i,v);
Positive Variables S(i,v), D(i,v), E(i,v);
Positive Variables VT(i,v), VP(i,v,p);
Positive Variables LT(i,r), LP(i,r,p);
*** Constraints declaration
Equations
Objective
MinAssignment
MOSAssignment
MinCard
MaxCard
MinCard1
MaxCard1
SetReqPrec1Time
SSTSetReqPrec1
Time
MinStart
MaxEnd
MinVolumeTotal
MaxVolumeTotal
VolumeCompo
MinLevelTotal
MaxLevelTotal
MinLevelProduct
MaxLevelProduct
LevelCompo
LevelTotalDef
LevelProdDef
CompositionCst
MinFlowrate
MaxFlowrate
TotalDuration
MinDemand
MaxDemand
MinProperty
MaxProperty
MinEndLevelTotal
MaxEndLevelTotal
MinEndLevelProduct
MaxEndLevelProduct
NoOverlapClique
SBClique2
;
*** Constraints construction
Objective..
OBJ =E= Sum((i,v,p),val(v,p) * VP(i,v,p)) ;
MinAssignment(i)..
Sum(v,Z(i,v)) =G= 1 ;
MOSAssignment(i,vs)$CLIQUE(vs)..
Sum(v$VSET(vs,v),Z(i,v)) =L= 1 ;
Mincard(vs)$(minN(vs)>0)..
Sum((i,v)$VSET(vs,v),Z(i,v)) =G= minN(vs) ;
MaxCard(vs)$(maxN(vs)<INF)..
Sum((i,v)$VSET(vs,v),Z(i,v)) =L= maxN(vs) ;
Mincard1(i,vs)$(ord(i)=1 And minN1(vs)>0)..
Sum(v$VSET(vs,v),Z(i,v)) =G= minN1(vs) ;
MaxCard1(i,vs)$(ord(i)=1 And maxN1(vs)<INF)..
Sum(v$VSET(vs,v),Z(i,v)) =L= maxN1(vs) ;
SetReqPrec1Time(vs)$SETREQPREC1(vs)..
Sum((i,v)$SETREQPREC1ANTECEDENT(vs,v), E(i,v))=L= Sum((i,v)$SETREQPREC1SUBSEQUENT(vs,v), S(i,v));
SSTSetReqPrec1(i,vs)$SETREQPREC1(vs)..
- 07-01· 禁教唐诗算术能还幼儿快
- 07-01· 2011年06月17日
- 07-01· 唐诗宋词英译:李商隐 筹
- 07-01· 仿评《唐诗1000首》第186首
- 07-01· 没事干的时候背背唐诗吧
- 07-01· [转载]唐诗中“斜”字该读
- 07-01· 湖南醴陵瓷业转型升级
- 07-01· 奇瑞风云2两厢黑色|2010款
- 07-01· 摩根士丹利华鑫摩根士丹
- 07-01· 摩根士丹利华鑫近期优选
- 07-01· 中金投行部大摩出售中金
- 07-01· 摩根士丹利招聘6月2日【实
- 07-01· 营养防病圣典
- 07-01· 《博伽梵歌原意》之第十
- 07-01· [不错]斑斓圣典---减肥中常
- 07-01· 武乐圣典《太极武当》:武
- 07-01· 铁血英雄-现阶段战功牌兑
- 07-01· 2011年06月10日【原创】南歌
- 07-01· 【淘宝网信息】- 2010年的
- 07-01· 深圳品牌女装有哪些?