What do i set U to?

Skip to first unread message

Sanjana Achar

Nov 14, 2023, 11:10:46 AM11/14/23
to AMPL Modeling Language
I have attached 2 files. A .dat and .mod regarding a firehouse location. 

I have put a new constraint in which is U. I wanted to know what do I set U to, in order to get a different output than just all 1's(which is the original output) I will attach the initial .mod and .dat file too. 

The originial is Firehouse 
The one with the new constraint U is SAHC-hw7

Please let me know, 

AMPL Google Group

Nov 14, 2023, 9:01:05 PM11/14/23
to AMPL Modeling Language
After solving the problem, have a look at the left and right sides of "sum{e in DSTRCTS} y[d,e] <= U":

ampl: display {d in DSTRCTS} (sum{e in DSTRCTS} y[d,e]), U;
sum{e in DSTRCTS} y[d,e] [*] :=
A  2
B  0
C  0
D  0
E  3

U = 2850

You can see that this constraint is not having any effect, because the value of param U is much larger than the optimal values of sum{e in DSTRCTS} y[d,e]. To make any difference to the solution, you will need to set U to be smaller than at least one of the values of sum{e in DSTRCTS} y[d,e].

The two "display" statements at the end of firehouse.mod and SAHC-hw7.mod are only displaying the values of x[d] and y[d,e] that are > 0 -- so necessarily the output is all 1's. If instead you write "display x, y;" then you will see both 0 and 1 values.

Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
Reply all
Reply to author
0 new messages