Right hand side expression of a constraint

20 views
Skip to first unread message

程颖毅

unread,
Feb 10, 2015, 8:31:44 AM2/10/15
to am...@googlegroups.com
I have put a decision variable w[x,y,t] on the right hand side of a constraint and it is reported that i and j are undefined. In the AMPL book, it uses avail[s] on the right hand side of a formula.

param r {(x,y) in stope};
var w {(x,y) in stope, t in 1..T} binary;

subject to rate {t in 1..T}:
sum {(x,y) in block}r[x,y]*w[x,y,t]<=r[x,y];

r[x,y] was defined previously as 
2 1 200000
2 2 200000
2 3 200000
2 4 200000
2 5 200000
2 6 200000
.       .                  .
.       .                  .
7      7      200000;

Could anyone give me some advice? Thank you.

Robert Fourer

unread,
Feb 10, 2015, 4:02:39 PM2/10/15
to am...@googlegroups.com
In the statement of the constraint in your question, the decision variable r[x,y] is on the *left* side of the constraint. In the parameter expression r[x,y] on the right side, x and y are undefined because the scope of {(x,y) in block} on the left goes only as far as r[x,y]*w[x,y,t] -- that is, to the end of the term being summed. Probably you meant to write r[t] (and to index param r over 1..T).

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages