I have a rather technical question about AMPL.
I am trying to do a little computational study. I have one .mod-file and
multiple .dat-files.
My purpose is to write a .run-file that always uses the same .mod file, but
varies the .dat-file.
My question is:
How can I tell AMPL to solve the model for each .dat-file? I want AMPL to
change the path to the .dat-file automatically. Is this possible, so that I
don`t have change the path to the .dat-file manually everytime I want to
solve the model with another .dat-file?
I hope you understand my problem.
Thanks for your replies!!!
--
View this message in context: http://old.nabble.com/How-to-solve-one-model-with-multiple-.dat--files-with-help-of-a-.run-file--tp32503825p32503825.html
Sent from the AMPL mailing list archive at Nabble.com.
Thanks for your answer. Your first interpretation is correct. I have
constructed a set of data files in excel and converted them into .dat.files.
Now I want the run file to run them against the model in one batch. Is there
a special command that makes this possible?
Greets
--
View this message in context: http://old.nabble.com/How-to-solve-one-model-with-multiple-.dat--files-with-help-of-a-.run-file--tp32503825p32557629.html
Bob Fourer
4...@ampl.com
String-valued expressions may appear in place of literal strings in
several contexts: in filenames that are part of commands, including model,
data, and commands, and in filenames following > or >> to specify
redirection of output; in values assigned to AMPL options by an option
command; and in the string-list and the database row and column names
specified in a table statement. In all such cases, the string expression
must be identified by enclosing it in parentheses.
Here is an example involving filenames. This script uses a string
expression to specify files for a data statement and for the redirection of
output from a display statement:
model diet.mod;
set CASES = 1 .. 3;
for {j in CASES} {
reset data;
data ("diet" & j & ".dat");
solve;
display Buy >("diet" & j & ".out");
}
The result is to solve diet.mod with a series of different data files
diet1.dat, diet2.dat, and diet3.dat, and to save the solution to files
diet1.out, diet2.out, and diet3.out. The value of the index j is converted
automatically from a number to a string as previously explained.
> --
> You received this message because you are subscribed to the Google Groups
> "AMPL Modeling Language" group.
> To post to this group, send email to am...@googlegroups.com.
> To unsubscribe from this group, send email to
> ampl+uns...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ampl?hl=en.
>
>
>
--
View this message in context: http://old.nabble.com/How-to-solve-one-model-with-multiple-.dat--files-with-help-of-a-.run-file--tp32503825p32590062.html