help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Re: logic conditions in MathProg


From: Andrew Makhorin
Subject: [Help-glpk] Re: logic conditions in MathProg
Date: Sun, 8 Feb 2004 11:19:47 +0300

>I want to do a very simple thing: I want to sum the hours of a time
>slot only when a given employee is assigned to it.
>
>this won't work:
>
>WorkedHrs[e]= sum {s in Slots: Assignments[s]=e} Hours[e];
>
>this won't work, too:
>
>WorkedHrs[e]= sum {s in Slots} 0+ (if Assignments[s]=e then Hours[s] );
>
>
>I get the error message
>
>Reading model section from bernardi.mod...
>bernardi.mod:44: operand preceding = has invalid type
>Context: ...} : WorkedHrs [ e ] = sum { s in Slots : Assignments [ s ] =
>Model processing error

In your model 'Assignments' is a variable, not a parameter, so the
MathProg translator cannot generate corresponding constraints (it needs
the value of Assignments[s], which is unknown on the generating phase).

You can find more detailed answer to your question in sci.op-research
(see http://groups.google.com).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]