Tim S
unread,Jun 11, 2012, 2:52:10 PM6/11/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AMPL Modeling Language
Hi Mr. Fourer,
I am experiencing an error where I am telling AMPL to use the gurobi
solver, but then get a "cannot find MINOS" error. Below are the model,
data, and run files. I've found that when I comment out the last line
of the model file related to Problem 3, then I no longer get that
error. If you could please provide some feedback as to why this error
is occurring and what I can do to fix it, I'd greatly appreciate it.
Regards,
Tim
Model File:
param d;
param c;
param p;
set D:= 1..d;
set C:= 1..c;
set P:= 1..p;
param r{k in D, i in D, j in D};
param s{k in D, i in C, j in C};
param t{k in D, l in C, i in P, j in P};
param h:= 1/d;
var u{D} >=0;
var v{C} >=0;
var w{P,C} >=0;
param x{k in D} >=0;
param y{l in C} >=0, default 1;
param z{m in P, l in C} >=0;
# Problem 1:
maximize DMweights{i in D}: sum{j in D} (sum{k in D} h*r[k,i,j])*u[j];
s.t. P1C1: sum{j in D} (sum{k in D, i in D} h*r[k,i,j])*u[j] = 1;
s.t. P1C2{i in D}: sum{j in D} (sum{k in D} h*r[k,i,j])*u[j] >=
d*u[i];
# Problem 2:
maximize CRweights{i in C}: sum{j in C} (sum{k in D}
x[k]*s[k,i,j])*v[j];
s.t. P2C1: sum{j in C} (sum{k in D, i in C} x[k]*s[k,i,j])*v[j] = 1;
s.t. P2C2{i in C}: sum{j in C} (sum{k in D} x[k]*s[k,i,j])*v[j] >=
c*v[i];
# Problem 3:
maximize ProjCrweights{i in P, l in C}: sum{j in P} (sum{k in D}
x[k]*t[k,l,i,j])*w[j,l];
s.t. P3C1{l in C}: sum{j in P} (sum{k in D, i in P}
x[k]*t[k,l,i,j])*w[j,l] = 1;
s.t. P3C2{i in P, l in C}: sum{j in P} (sum{k in D}
x[k]*t[k,l,i,j])*w[j,l] >= p*w[i,l];
problem Prob1{i in D}: u,DMweights[i], P1C1, P1C2;
problem Prob2{i in C}: v,CRweights[i], P2C1, P2C2;
problem Prob3{i in P, l in C}: w, ProjCrweights[i,l], P3C1[l], {g in
P} P3C2[g,l]; # this is the line that allows the problem to work
when commented out
Data File:
param d:= 1;
param c:= 4;
param p:= 3;
param x:=
1 1;
param s:=
[1, *, *]: 1 2 3 4:=
1 1 5 3 2
2 0.2 1 0.2 0.2
3 0.333333333 5 1 0.333333333
4 0.5 5 3 1;
param t:=
[1, 1, *, *]: 1 2 3:=
1 1 3 2
2 0.333333333 1 0.333333333
3 0.5 3 1
[1, 2, *, *]: 1 2 3:=
1 1 0.5 0.5
2 2 1 0.5
3 2 2 1
[1, 3, *, *]: 1 2 3:=
1 1 0.25 1
2 4 1 4
3 1 0.25 1
[1, 4, *, *]: 1 2 3:=
1 1 2 2
2 0.5 1 2
3 0.5 0.5 1;
Run File:
model Test.mod;
data Test.dat;
option solver gurobi_ampl;
for {i in 1..1}
{
solve Prob2[i];
let y[i]:= CRweights[i];
}
display y;