lingo一句中两次使用同一个下标,但两次的限制条件是不一样的,如何解决???
model:sets:Time/1..96/:Pw,D,DA,DL;Gener/1..10/:Ph1max,Ph1min,Ph2max,Ph2min;Stor/1..5/...
model:
sets:
Time/1..96/:Pw,D,DA,DL;
Gener/1..10/:Ph1max,Ph1min,Ph2max,Ph2min;
Stor/1..5/:Psgmax,Psgmin;
Gtime(Gener,Time):Ih1,Nh1;
Stime(Stor,Time):Ps,Pg,Is,Ig;
endsets
data:
enddata
@for(Gtime(i,j):Ih1(i,j)=1);
****@for(Gtime(i,j)|j#GE#20:Nh1(i,j)=@sum(Time(k)|(j-20)#LT#k#LE#j:Ih1(i,k)));******
end
Gtime是Time和其他集派生的,其中含有Time的索引,后面求和又要用到Time的索引,我用j和k,本想会有区分,但是结果不行!其中j和k的范围要求是不同的!求大神帮帮忙,谢谢啦。。。。。。。 展开
sets:
Time/1..96/:Pw,D,DA,DL;
Gener/1..10/:Ph1max,Ph1min,Ph2max,Ph2min;
Stor/1..5/:Psgmax,Psgmin;
Gtime(Gener,Time):Ih1,Nh1;
Stime(Stor,Time):Ps,Pg,Is,Ig;
endsets
data:
enddata
@for(Gtime(i,j):Ih1(i,j)=1);
****@for(Gtime(i,j)|j#GE#20:Nh1(i,j)=@sum(Time(k)|(j-20)#LT#k#LE#j:Ih1(i,k)));******
end
Gtime是Time和其他集派生的,其中含有Time的索引,后面求和又要用到Time的索引,我用j和k,本想会有区分,但是结果不行!其中j和k的范围要求是不同的!求大神帮帮忙,谢谢啦。。。。。。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询