2017-04-16 8 views
0

私はGLPKに変換しようとしているAMPLモデルファイルを持っています。それは始まります。これを実行するときGLPK:デフォルトの次の式を設定すると、1ではなく2の次元が必要です

param n;  # The number of nodes in the graph 
set V := {1 .. n}; # The set of vertices in the graph 
set E within V cross V; # The set of edges in the graph 
set NE within V cross V := {i in V, j in V: i < j} diff E; 
set FIXED within V cross V default {}; # The set of demand pairs with fixed flow 

は、私は次のエラーを取得する:これはMathProgとそのスーパーセット間の構文上の違いでなければなりません

_test.mod:5: set expression following default must have dimension 2 rather than 1 
Context: : i < j } diff E ; set FIXED within V cross V default { } ; 
MathProg model processing error 

、AMPLのコードをAMPL-実行すると、完璧に動作します。 MathProgで2Dの空集合をどのように表現しますか?

答えて

0

さてさて、ソリューションのハックはこれです:

set FIXED within V cross V default {i in V, j in V: 1 < 0}; 

明らかに偽の条件を入れてください。それはあなたが望む次元を持ち、まだ空になります。

関連する問題