Re: If-Then Statements

20 views
Skip to first unread message
Message has been deleted

johnthe...@gmail.com

unread,
Jan 18, 2017, 1:02:30 PM1/18/17
to AMPL Modeling Language
Any help please???

Robert Fourer

unread,
Jan 18, 2017, 1:20:34 PM1/18/17
to am...@googlegroups.com
To get some help with your situation, I suggest that you post your AMPL model and data including as much of the objective and constraints as you have been able to write, and then ask a specific question about some aspect of the constraints that you are having trouble with. Readers of this forum are often reluctant to reply with a complete list of constraints in response to a general formulation, because then they are doing all the work.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of johnthe...@gmail.com
Sent: Tuesday, January 17, 2017 9:16 AM
To: AMPL Modeling Language
Subject: [AMPL 13380] If-Then Statements

Quick question:

In this exercise:
I'm making 3 chairs: A, B, C
I have 5 materials: 1, 2, 3, 4, 5.

The table looks like this:

A B C Supply
1 3 3.75 2.75 750
2 1 1.25 1.75 425
3 0.75 0.5 0.875 300


4 0.75 1.5 1.375 424
5 0.625 0.75 0.75 199

I've done all the modelling on the .dat and .mod files. I just need help with the constraints. i.e. 'Subject to'

The question is:
I have to use material 1 in all chairs.
I have a choice between using: material 2 and 4 & material 3 and 5.
I have to use only one of them. Not both.

For example: The possible combinations of materials are:
Materials - 1,2,3 1,2,5 1,3,4 1,4,5

Our objective is to maximize profit.

How do I code this on to AMPL?


johnthe...@gmail.com

unread,
Jan 18, 2017, 1:22:59 PM1/18/17
to AMPL Modeling Language, 4...@ampl.com
thanks, i'll edit it and add my codes too.
Reply all
Reply to author
Forward
0 new messages