The issue is that set's contain objects (like numbers, strings, other sets).
They are not considered as really having numeric entries. But param's do. So
the trick is to create a param array that translates the object in the set to
the numeric value.
Try (look for the red bold where the param array tt is used):
param tmax;
set T:= 1..tmax;
param tt{t in T} := t;
...
subject to PrecTemp{i in A,j in A}: sum{t in T} tt[t]*x[j,t] >= sum{t in T}
tt[t]*x[i,t] + d[i] ;
data;
param tmax := 720;
end;
From: [email protected]
[mailto:[email protected]] On Behalf Of
Daniele Micarelli
Sent: Tuesday, July 03, 2012 7:38 AM
To: [email protected]; [email protected]; [email protected];
[email protected]
Subject: [Help-glpk] cannot convert 1..720 to floatin-point number
[Help-glpk] cannot convert 1..720 to floatin-point number
tried the recommended changes, but nothing to do
the error "cannot convert 1..720 to floatin-point number" occurs in the bond
"subject to PrecTemp{i in A,j in A}: sum{t in T} t*x[j,t] >= sum{t in T}
t*x[i,t] + d[i] ; /* vincolo precedenze temporali */ "
x[i,t] is the variable
d[i] is the numeric parameter
thank yuo very much
________________________________
This e-mail and any attachments may be confidential or legally privileged. If
you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return e-mail.
Thank you for your cooperation.
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk