unbounded ray error

8 views
Skip to first unread message

gehad mostafa

unread,
Dec 6, 2016, 6:55:26 AM12/6/16
to AMPL Modeling Language
hey guy,,

after adding the new objective and the first two constraint it gives me unbounded ray error., I don't know  what is the problem and this is my model:

param step default 1;
param start default 1;

param worker;
param task;
param period;
param workday;
param shift;

set I= start..worker by step;
set J= start..task by step;
set K= start..period by step;
set D= start..workday by step;
set S= start..shift by step;


param a{I,J};
param h{J};
param t{J,K,D,S};
param w{J};
param c{I};
param p{I,J};


var x{I,J,K,D,S} binary;
var y{I} binary;
var z{I,D,S} binary;
var v1 integer;
var v2 integer;
var v3 integer;
var v4 integer;



minimize labor:
v2+v3;

subject to constraint0 {d in D}:
sum {i in I} y[i]*c[i]+v1+v2=30;

subject to constraint01 {d in D}:
sum {i in I,j in J} y[i]*p[i,j]+v3+v4=130;

subject to constraint1 {i in I,d in D,s in S}:
sum {j in J,k in K} h[j] * x[i,j,k,d,s] <= 1 ;
subject to constraint2 {i in I,k in K,d in D,s in S} :
sum {j in J} x[i,j,k,d,s] <= 1;
subject to constraint3 {j in J,k in K,d in D,s in S}:
sum {i in I} x[i,j,k,d,s] = w[j]*t[j,k,d,s];
subject to constraint4 {i in I,j in J,k in K,d in D,s in S}:
x[i,j,k,d,s] <= z[i,d,s];
subject to constraint5 {i in I,j in J,k in K,d in D,s in S}:
x[i,j,k,d,s] <= a[i,j];
subject to constraint6 {i in I,j in J,k in K,d in D,s in S}:
x[i,j,k,d,s] <= t[j,k,d,s];

subject to constraint60 {d in D}:
sum {i in I} y[i] = 5;

subject to constraint7 {i in I,d in D}:
sum{s in S} z[i,d,s] <= 1*y[i];

subject to constraint8 {i in I}:
sum{d in D,s in S} z[i,d,s] = 2*y[i];

subject to constraint9 {i in I,s in S,d in D: d >1 && d <3}:
z[i,d+1,s] <= z[i,d,s]+(1-z[i,d-1,s]);

Alessandro Oscar Gilardino Arias

unread,
Dec 6, 2016, 7:31:00 AM12/6/16
to am...@googlegroups.com

Hi

Maybe you should only declare your variables adding >=0

Regards


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+unsubscribe@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages