[AMPL 2821] Solving several problems

View: New views
2 Messages — Rating Filter:   Alert me  

[AMPL 2821] Solving several problems

by pioneer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

Is there a nice way to do the following:

1. Solve problem 1, store results
2. Solve problem 2, store results

3. Display results from both problems


In order to use the "problem" statement it seems I have to define the
problem, naming all the variables in my problem, it is messy for me to
list all the variables/constraints, and also the names of the
variables/constraints in my two problems overlap.

I am looking for something like having separate workspaces for each
problem, for instance:

solve model1
store results in workspace1

solve model2
store results in workspace2

then,

activate workspace1;
display results
activate workspace2;
display results

Any ideas?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---


[AMPL 2838] Re: Solving several problems

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



There is only one namespace in an AMPL session, so what you describe is not
possible.  Of course if model1 and model2 were completely independent, then
you could solve model1, display results of model1, do a "reset;", solve
model2, and display results of model2; but from your question I get the
impression that your situation is not that simple.  (Perhaps some
information from model1 must be used in defining model2, or the results from
the two models are displayed together.)  You might be able to work out a
scheme where you write some results from model1 to a file, then read them
back after resetting and solving model2.

Bob Fourer
4er@...


> -----Original Message-----
> From: ampl@... [mailto:ampl@...]
> On Behalf Of pioneer [spencer.math@...]
> Sent: Tuesday, September 15, 2009 10:07 AM
> To: AMPL Modeling Language
> Subject: [AMPL 2821] Solving several problems
>
>
> Hi,
>
> Is there a nice way to do the following:
>
> 1. Solve problem 1, store results
> 2. Solve problem 2, store results
>
> 3. Display results from both problems
>
>
> In order to use the "problem" statement it seems I have to define the
> problem, naming all the variables in my problem, it is messy for me to
> list all the variables/constraints, and also the names of the
> variables/constraints in my two problems overlap.
>
> I am looking for something like having separate workspaces for each
> problem, for instance:
>
> solve model1
> store results in workspace1
>
> solve model2
> store results in workspace2
>
> then,
>
> activate workspace1;
> display results
> activate workspace2;
> display results
>
> Any ideas?
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---