Thank you Mr. Marcel for your reply, and I am sorry for constantly bothering you with questions. However, I am still facing issues with me model and I’m unable to solve them.
The first issue is the wastage portion of my model. In short, I created a set called manufacturing period (m) and made it a subset of the time period (t). After wards I used both sets to create the constraint for the medication shelf-life, which as you know will decline with time uattached is image#1 of the shelf-life constraint]. After getting the proper shelf-life values, despite the negative answers, I decided to use the shelf-life variable as a condition for the if-then statement to get the amount of wastage that will be produced from not selling that medication. Obviously, AIMMS reject having a variable be the subject of the if-then statement, despite giving me no errors when I check and commit the definition of the constraint uattached is image#2 of the wastage constraint]. When running the model I get the following message: “The definition of constraint 'Wastage_Constraint(1,1,1,1)' contains an if-then-else statement with a variable in the condition, which cannot be handled by BARON.”, which transforms the model into an MINLP one and makes defining the wastage amount extremely difficult.
The second issue is the uncertainty of the model. I require that one parameter; the medication demand, be uncertain to make the model more realistic. However, despite following the model in the link you sent me in your first reply about parameter uncertainty, I am getting all sorts of error messages when I execute the Robust model procedure. The main error message is: “Warning: Generation of the robust counterpart failed because constraint 'Provider_Inventory_Constraint(1,1,1)' induces an infeasibility for uncertain parameter 'Medication_Demand(1,1)': an equality constraint containing an uncertain parameter can only be satisfied if a (non-adjustable) variable is multiplied by this parameter, or an adjustable variable depends on it.” I also tried to set a simple definition for the uncertainty, and all the constraints involved in with this uncertain parameter started showing errors saying that the left side of the constraint isn’t uncertain as well.
I am sorry for the very long reply, and appreciate any help you can provide. It may be too much to ask, but if you would be willing to have a video call through Zoom or MS Teams it would greatly help me in finishing this model for my thesis.
Regards,
Mohamad Khaled Mtit
You cannot use a while-loop inside a constraint definition. You should use the definition without the while part.
I would advise you to print the constraint listing and inspect it. The constraint listing will be printed in the listing file, inside the log folder, if you set the following options:
- - Solvers General option 'Constraint Listing' to 'At every solve' (or 'At first solve');
- - Solvers General option 'Constraint Listing Variable Values' to 'Print variable values';
Maybe AIMMS generates
Shelf_Life(p,m,t) = - Medication_Decap(p)
for some (p,m,t) and that makes the model infeasible if Shelf_Life(p,m,t) is nonnegative and Medication_Decap(p) is positive. You can check this in the constraint listing.
Dear Mr. Marcel
I would like to thank you for your help and I am sorry for the late reply. I will take a look at the robust optimization link you provided for the uncertainty definition. For the Shelf_Life variable I want the data/results to be positive only, and even when using the non-negative range in defining the Shelf_Life variable, I’m not getting a result. I am getting a result only when the range is free.
I tried defining the Shelf_Life in a while-loop but I keep getting a message that says that “the term while is unexpected” (attached is an image of the message I’m getting). The problem is that I need to use the Shelf_Life variable to define the relationship of another variable.
From my limited experience in programming, I know that an if-then statement or a while-loop statement is the best thing for my research project, but I seem to be having an issue defining them properly despite following the manuals and their examples.
I appreciate your help and support, and would hope you could help me in this matter since I am not finding much material on Youtube or online to fix the error messages.
Regards,
kmohamad095.
Hi @kmohamad095. The definition of the uncertain parameter 'Medication_Demand' looks fine but uncertain parameters are only meaningful (in AIMMS) if they are used in combination with robust optimization, that is, if you use the function GMP::Instance::GenerateRobustCounterpart. See Chapter 20 in the Language Reference for more information. For an example, see: https://how-to.aimms.com/Articles/484/484-Uncertainty-productionplanningro.html .
To get rid off the warning you should use
(p,m,t)|ord(m) < ord(t)
in the index domain of the constraints 'Shelf_Life_Constraint2'. (Your formulation is fine but AIMMS throws a warning which you can disable by switching off the option 'Warning comparing elements different sets’ as an alternative solution.)