> Hi, I am new with glpk and I am having trouble with a certain
> constraint. Basically I need certain sum to either be a precise number
> (given by a parameter) or equal to 0. Been trying different things for a
> while with no success, this was my last attempt.
> 
> s.t. tiempoProyecto {a in A}: ((sum{m in M,t in T} x[a,m,t]/personal[a])
> >= dedicacion[a]) or ((sum{m in M,t in T} x[a,m,t]/personal[a]) = 0);
> 
> 
> x declaration is:
> var x{a in A,m in M, t in T} binary >= 0;
> 
> 
> all sets and params are declared in a data file.
> 
> 
> That line gives me the error:
> parte2.glpk:30: operand preceding >= has invalid type
> Context: ...um { m in M , t in T } x [ a , m , t ] / personal [ a ] ) >=
> MathProg model processing error
> 
> 
> Any clue of how should I face this problem?
> thanks in advance
> 

You may model that condition as follows:

param p;
var z, binary;
s.t. ... sum ... = p * z;



_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to