Ok I figured it out by the prod.mod in the examples =)

s.t. r  {D1 in DIMENSION1, D2 in DIMENSION2, D3 in DIMENSION3} : sum {D4 in
DIMENSION4} H[D1, D2, D3, D4] <= 1;

2011/11/1 Nilo Cesar Teixeira <[email protected]>

> Hi again guys,
>
> I am trying to model a loop in 4 dimensions, in which for each possible
> fixed tuple of the first 3 dimensions, the sum of the values of the 4
> dimension must be at most 1.
>
> Every cell is, again, a binary variable.
>
> Something like this:
>
> for {D1 in DIMENSION1, D2 in DIMENSION2, D3 in DIMENSION3} {
> s.t. r: sum {D4 in DIMENSION4} H[D1, D2, D3, D4] <= 1;
> }
>
> But then I found that constraints are not permitted inside fors.
>
> Why ? How to procede then ?
>
> Thanks again.
>
> --
> *Nilo Cesar Teixeira*
> [email protected]
>



-- 
*Nilo Cesar Teixeira*
[email protected]
(55) (11) 8571-5314
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to