--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/WmUuyOd0S9M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-2077776189-6181125277-1669400866-1507244607%40helpscout.net.
Thanks a lot for your feedback
Now, the model is giving me the below error, and in everytime it changes the set. Am I defining the sets in the wrong way? or what's the problem exactly?
"S is already defined
context: set >>> S; <<< #Set of Input Nodes (S)"
And would you please advise me with an example model which i can use to check my model. As I'm always facing a different error.
Thanks in advance for your support
On Fri, Nov 25, 2022 at 6:27 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Your "var y = . . ." does not conform to the AMPL syntax for defined variables. But you do not need to define y in this way. Instead you should simply write
var y {i in A, j in A} binary;
Then your Arc_Capacities constraint will insure that x[i,j] > 0 implies y[i,j] = 1. Because your minimization objective includes the term "Arc_Fixed_Cost[i,j] * y[i,j]", any optimal solution that has x[i,j] = 0 (and Arc_Fixed_Cost[i,j] > 0) will also have y[i,j] = 0, so you do not need a "subject to" constraint for that.
You will need to make a similar correction for var v, which should not be hard to figure out.
Note that to say a variable is binary, your model should "binary" in the definition of the variable. Thus you should delete the "subject to Binary" constraints from your model.
--
Robert Fourer
am...@googlegroups.com
--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/WmUuyOd0S9M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-2077776189-6182092789-1669437759-1979469584%40helpscout.net.
Yes. I did that before but still got the same error message.
Any other suggestions?
Thanks in advance
On Sat, Nov 26, 2022 at 4:42 AM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
After you make changes to your model file, be sure to reset AMPL before trying to read the file again. For example:
reset;
model "Thesis Model Replication.mod";
--
Robert Fourer
am...@googlegroups.com