See the discussion of named problems in chapter 14, beginning with section 14.4 at
http://ampl.com/BOOK/CHAPTERS/17-solvers.pdf#page=30
Bob Fourer
From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of huynhiem
Sent: Friday, October 17, 2014 5:18 AM
To: am...@googlegroups.com
Subject: [AMPL 9325] loading and solving 2 problems in AMPL
Hi all,
I have 2 problems: a master and a slave. I first solve the master problem and use the values of the master problem's variables as the parameters for the slave problem. Then solve the slave problem, then use the values of the slave problem's variables as the parameters for the master problem, and so on. In AMPL script, it would look like below. Is there a way to name the problems when loading into memory and is there a way to tell "solve" command what problem to address? Thank you very much. Neo
----------------------------
model master_problem_model.mod;
data master_problem_data.dat;
model slave_problem_model.mod;
data slave_problem_data.dat;
repeat {
solve (the master problem);
# update LB, lower bound
# copy master problem's variables' values to slave problem's parameters
solve (the slave problem);
# update UB, lower bound
# copy slave problem's variables' values to master problem's parameters
} until LB=UB;
----------------------------
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.