RE: [AMPL 8459] Having trouble in writing the .dat file

135 views
Skip to first unread message

Robert Fourer

unread,
Apr 23, 2014, 4:42:13 PM4/23/14
to am...@googlegroups.com
Can you say what trouble you are having? When I read your .mod file into AMPL, I get an error message, and when I fix that I get more error messages ... so that it's impossible for me to even try reading your .dat file.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com]
On Behalf Of varu...@gmail.com
Sent: Tuesday, April 22, 2014 5:48 AM
To: am...@googlegroups.com
Subject: [AMPL 8459] Having trouble in writing the .dat file

I am having trouble writing the .dat file. I would really like your help.
I attach the files along with this....


Message has been deleted

Robert Fourer

unread,
Apr 25, 2014, 8:38:49 AM4/25/14
to am...@googlegroups.com
You might try looking at an IIS as described in a previous post today. Also AMPL's "expand" command can be useful to look at particular constraints to see if they were generated by AMPL as you expected. However in general, finding the cause of infeasibility requires a detailed knowledge of the model and data, so it's something that you can't get specific help with and that you have to work out yourself.
Sent: Thursday, April 24, 2014 4:47 AM
To: am...@googlegroups.com
Cc: 4...@ampl.com
Subject: Re: [AMPL 8473] Having trouble in writing the .dat file

I got that thing working and now it seems like I've got a different problem. When I solve it for lesser demands for example 2, the model worked but when I solve for larger demands (4), the model shows integer infeasible. Could you help me out?


Message has been deleted
Message has been deleted

Robert Fourer

unread,
May 1, 2014, 4:28:38 PM5/1/14
to am...@googlegroups.com

You can use any programming language to write a program that reads your data source and writes a .dat file in the proper format.  You have to figure out how to write the program, however.  The choice of language depends on which one you like best or which is most compatible with your project.

 

If you have unformatted files of data then it is also possible to use AMPL's "read" command to read some of the values into AMPL parameters (www.ampl.com/BOOK/CHAPTERS/12-data.pdf#page=21) though it is necessary to take some care to get this right.

 

Bob Fourer

am...@googlegroups.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of varu...@gmail.com
Sent: Tuesday, April 29, 2014 3:57 AM
To: am...@googlegroups.com
Cc: 4...@ampl.com
Subject: Re: [AMPL 8514] Having trouble in writing the .dat file

 

I'd like to ask you if it is possible to write the .dat file in python  in somewhat a similar way. I am trying to generate random numbers to the parameters and then put this stuff in xml. I want to know if its a good idea to be generating data for a .mod file using python. But I'm clueless about the link creation and capacity assignment stuff.

 

Reply all
Reply to author
Forward
0 new messages