Forum Discussion
FICO
6 years agoCommunity Manager
Naming sets where the elements are a combination of indices
Hello, I have a follow-up question on the MOSEL best practices described here, regarding naming sets: https://www.fico.com/fico-xpress-optimization/docs/latest/mosel/UG/dhtml/moselugapp_sec_secappn...
FICO
6 years agoCommunity Manager
A collection of index tuples for which a condition evaluates to 'true' is usually best represented via a sparse multidimensional array of Booleans in Mosel, see for example https://examples.xpress.fico.com/example.pl?id=loopproj
So an extension to several dimensions of the example from the Mosel User Guide that you are referring to could be:
declarations
I,J,K: range
Cond: dynamic array(I,J,K) of boolean
end-declarations
! Index tuples for which the condition holds
forall(i in I, j in J, k in K | isodd(i) and j<>k and (k mod 7 = 0)) Cond(i,j,k)
! Use the precalculated condition
forall(i in I, j in J, k in K | exists(Cond(i,j,k)) ) x(i,j,k) is_integer
...
sum(i in I, j in J, k in K | exists(Cond(i,j,k))) x(i,j,k) >= 10Related Content
Related Content
Combining sum and overall statement
Hi, I am trying to build a perishable supply chain model. To include perishability, I want to include a constraint in which for every period in time (T is the set of periods, indexed by t) the model...5 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread0Views0likes2Commentscombining mmxprs and/or nlsolv with mmquad or mmnl
I have two questions about combining mmxprs and/or nlsolv with mmquad or mmnl in Mosel: If I use the Xpress solver (mmxprs), can I trust that it will always detect that a constraint or objective is ...3 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum5 unread comments5 unread0Views0likes5Comments