Equation term consideration limited using conditions

Top  Previous  Next

(transbad.gms vs. transfix.gms)

An equation such as

 

slDEMANDEQ(MARKET)..

SUM(PLANT, SHIP(PLANT, MARKET))=G=DEMAND(MARKET);

 

can be generated faster by adding conditionals both on equation and term existence to avoid considering unnecessary cases

 

fsDEMANDEQ(MARKET)$demand(market)..

SUM(PLANT $cost(plant,market),SHIP(PLANT, MARKET)) =G=

DEMAND(MARKET);

 

In general, speed can often be helped by using tuples, subsets or conditionals to reduce inclusion of terms in .. equations only to relevant cases.