Thank you so much! After analyzing the model, I figured out a way to adjust it my way but I have one last problem.
When I run the new code, I get the following error:
ampl: reset;
ampl: model cassava_ext.mod;
cassava_ext.mod, line 41 (offset 2044):
i is undefined
context: s.t. Store_Demand {j in J, s in S}: sum {i in I} Y[i,j,s] >= >>> Min_Demand[i,s] <<< ;
ampl:
I believe it is pertaining to the following constraint:
s.t. Store_Demand {j in J, s in S}: sum {i in I} Y[i,j,s] >= Min_Demand[i,s];
Is there something that I am missing or forgot to code?
On Tue, Dec 7, 2021 at 2:12 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:The first and second bullets is what I actually want. Thank you so much! But how and where would I set param Cassava_Amount equal to sum {j in J} X[i,j]?
On Mon, Dec 6, 2021 at 8:59 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
It is possible to combine two models; in fact, there is a feature called "named problems" (AMPL book sections 14.4-14.5) that is designed for this purpose. However, in your description of what you want to do, it is not clear how the data of param Cassava_Amount should "rely" on the sum of decision variable X. This is one possibility:Here the first solve has only X[i,j] as the variables, while the second solve has only Y[j] as the variables. If this is what you want, I can suggest a good way to do it. But if you want something else, how would it be different from this?
- Solve cassava.mod for the optimal values of the variables X[i,j].
- Using the optimal values, set param Cassava_Amount[i] equal to sum {j in J} X[i,j].
- Solve cassava_extended.mod for the optimal values of the variables Y[j].
--
Robert Fourer
am...@googlegroups.com