Forum Discussion
FICO
5 years agoCommunity Manager
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 sums over certain periods of time.
Let's say that x(t, i) is the production in period t, in location i. The variable d(t, i) denotes demand. The variable w(t,i) represents the products perished. Theta is a constant which represents the life time of a product.
To include perishability in the model, the following constraint is included:
forall(t in Theta..NT, i in I) w1(t, i) >= sum(tau in 0..t-Theta) x(t,i) - sum(tau in 0..t, i in I) d(t, i) - sum(tau in 0..t) w(t-1, i)
The idea is to take the total amount of products produced that should be perished in this period and subtract the fulfilled demand up to this period and the products that perished previous periods. The remaining part should than be the part of production that perishes this period.
On the right-hand side of the constraint, I replaced t by tau since I still want to sum over t, but Xpress does not allow me to do that. Is this the right way to implement this? The model I have so far does work, but the results are not correct and I think it has to do with this constraint.
2 Replies
- FICOCommunity Manager
Hi Stijn,
if you define your constraint for all t in Theta..NT, then "t" is already defined and can't be reused as a summation index. Naming those other summation indices tau should be fine, but then you should also sum over x(tau,i) [and similarly for the other two], if you want to compute the sum of all productions in previous periods, currently you would just add the production of the current period once for each previous period.
- FICOCommunity Manager
Thank you! This helps a lot!
Related Content
Related Content
combining 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 unread0Views0likes5CommentsHow to combine the largest subtours together
Hi, I worked on an assignment where i need to make a tour to visit various retail shops. Where the distance needs to be minimized. I obtained a solution with various sub-tours. I found out how to el...6 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum7 unread comments7 unread0Views0likes7CommentsNaming 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...6 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum3 unread comments3 unread0Views0likes3Comments