forall(i in nbus,j in tavail,k in nport)
{ct3:if(soc[k][j]<=0.3&&pt[i][j]<pl[i][j])
{ pbatch[j][k]-(0.7-soc[k][j])*100000==0;}
else
{pbatch[j][k]==0;}}
range nbus=1..1;
range tavail=1..3;
range nport=1..4;
int soc[k in nport][j in tavail]=rand(2);
int pl[i in nbus][j in tavail]=rand(4);
int pt[i in nbus][j in tavail]=rand(10);
dvar float+ pbatch[tavail][nport];
subject to
{
forall(i in nbus,j in tavail,k in nport)
{ct3:if(soc[k][j]<=0.3&&pt[i][j]<pl[i][j])
{ pbatch[j][k]-(0.7-soc[k][j])*100000==0;}
else
{pbatch[j][k]==0;}}
}
1条答案
按热度按时间vvppvyoh1#
工作正常