10.3 Set Subsets with the OVER Operator

The OVER operator can be used in summations and other underlying index lists. This is useful, for example, when you need to sum over a subset of a multi-dimensional index that contains certain domain index element. Here is an example:

    INDEX
       depot   := ...
       factory := ...
       FactDepot[factory,depot] := ...

    SUBJECT TO

      DepotCapacity[depot]:

        SUM(FactDepot OVER factory: Ship[FactDepot]) <= DepotCap[depot];

In this example we need to sum over the factories that ship to the depot and make sure that the total amount shipped is less than the capacity for the depot. Notice that in this example the Ship variable is defined with the FactDepot index.


Back To Top | Maximal Home Page | Table of Contents | Previous Page | Next Page