Modification

26 views
Skip to first unread message

Sanjana Achar

unread,
Nov 20, 2023, 3:46:16 PM11/20/23
to AMPL Modeling Language
Hello, 
I have attached a .mod and .dat file and I would like to know what modifications need to be done to the files attached in order to solve this problem. 

You are the proud inventor of ”The best barbecue sauce on earth.” You
have four plants with the following stock: Accident, Maryland (AMD)
has 250 bottles, Chicken, Alaska (CAK) has 500, Embarrass,
Minnesota (EMN) has 300, and Experiment, Georgia (EGA) has 400.
Your orders for next week are as follows: New Jersey (NJ) 150; New
York City (NYC) 250; South California (SCA) 300; Florida (FL) 250;
Texas (TX) 100; Alabama (AL) 150; Colorado (CO) 150; Nevada
(NV) 100.
You also have 1500 bottles of your very special ”Chicken with a
Rythm: the world’s best chicken spice” at your AMD plant, and you
have the following orders for this spice: NJ 350 NYC 250 TX 500 CO
400.
The following list provides the unit shipping costs in cents (the same
for both products): CAK→EMN 10, EMN→NYC 8, EMN→CO 3,
CO→NV 5, NV→SCA 2, TX→NV 3, AL→TX 1, AL→CO 3,
EMN→AL 4, AMD→NJ 4, NJ→NYC 3, AMD→FL 4, AMD→EGA
4, EGA→AMD 3, EGA→AL 5, EGA→FL 2, EGA→TX 6, FL→TX
5, TX→SCA 6.
Both products are delivered in same sized boxes. For each shipping
segment we have a capacity given the number of boxes we can ship
through that route: CAK→EMN 320, EMN→NYC 230, EMN→CO
290, CO→NV 190, NV→SCA 120, TX→NV 150, AL→TX 90,
AL→CO 110, EMN→AL 180, AMD→NJ 120, NJ→NYC 250,
AMD→FL 230, AMD→EGA 500, EGA→AMD 400, EGA→AL 700,
EGA→FL 600, EGA→TX 500, FL→TX 400, TX→SCA 250.
Create a model and ampl implementation to find a cost minimizing
delivery plan to distributors that ordered your products (fulfilling
orders as much as possible.)


BBQ.mod
BBQ.dat

AMPL Google Group

unread,
Nov 21, 2023, 2:24:11 PM11/21/23
to AMPL Modeling Language
Is this an exercise assigned to your class? (It seems too small and simple to be coming from an actual company.) I would not want to give away the answer. If you have made a start at modifying your AMPL model, however, and you have a more narrow concern -- such as how to write a certain AMPL statement correctly, or interpret a particular error message, or use a particular solver -- then I encourage you to ask your question in our new user forum.

Be sure to include a copy of the most recent version of your AMPL statements (or attach your model and data files) and provide the full text of any error messages that you are seeing.


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2427728381-120716#}

Sanjana Achar

unread,
Nov 27, 2023, 11:50:25 AM11/27/23
to AMPL Modeling Language
In order to solve the problem, (I have attached it as a picture), I added print statements, is that the only modification that needs to be made? 

Please let me know, 

SAHC-hw9.mod
SAHC-hw9.dat
Screenshot 2023-11-27 at 11.45.21 AM.png

AMPL Google Group

unread,
Nov 28, 2023, 8:21:13 PM11/28/23
to AMPL Modeling Language
Your print statements are correct. Actually you have more statements than you need, since they display the same list of genes twice,

Selected Genes: B C F
set TARGET := B C F;


Since this is a homework assignment, I must leave it to you to determine whether your model is correct.


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2434435009-120848#}
Reply all
Reply to author
Forward
0 new messages