
如圖是我想要實作的效果。
由于GAMS中if和loop陳述句都不能用于方程賦值,所以我采用了$。如下:
equation constr_1(i$i.val<>j.val,j);
constr_1(i$i.val<>j.val,j)..t(i)+M*(1-x(i,j))=g=t(j)+p(j);
這里.val后綴的使用參考的是:

但是沒有詳細介紹,我也不知道具體應該怎么使用。
運行后報錯:
185 Set identifier or '*' expected
142 No suffix allowed here - suffix ignored
148 Dimension different - The symbol is referenced with more/less
indices as declared
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/268776.html
標籤:其他技術專區
上一篇:tensorflow中如何將一組雙向LSTM的最終輸出作為另一組雙向LSTM的輸入
下一篇:如何實作電子圍欄
