[Couenne] Accessing AMPL parameters
Pietro Belotti
belotti at lehigh.edu
Tue Jan 5 18:05:32 EST 2010
Dear Pete,
> I am currently modifying Couenne, so that it can handle a multi-dimensional
> integral term,
> I want to manually obtain parameter values defined in the AMPL problem
> instance, ie. "param x := 1".
> Do you know how to access the data structure containing these values.
The "param" keyword introduces parameters for which no symbol table is
passed by AMPL, at least to my knowledge. I believe you should use the
"option" instruction in AMPL, but unfortunately this is not yet read
by Couenne. With the AMPL command
option x 1;
you are creating a "parameter" that is passed to the solver, which can
read it in a way similar to an option file. Couenne doesn't have such
capability yet -- this actually just amount to adding a few lines that
hook the option names available for use in the couenne.opt file to
options usable in the AMPL code. I have little time for that now, but
it's in the todo list.
> I am trying to avoid modifying the ASL library, by "hijacking" the MIN(x,y)
> function and using it
> to represent my integral function. The integral is defined by one variable,
> and many parameters,
> so the first argument is the variable, and the second argument is intended
> to point to a set of
> parameter values.
If I get this correctly, this is a momentary fix for the "param x :=
1;" that is not working and the "option x 1;" that will (eventually)
be implemented. You could indeed modify the exprMin so that its
::operator() computes the value by referring to the first argument
(referred to as arglist_ [0] -> Value ()). All other "options" can be
accessed similarly with arglist_ [1] -> Value (), etc. At the moment I
can't think of other methods you should change.
Hope this helps.
Cheers,
Pietro
_________________________________________
Pietro Belotti, Lehigh University
Dept. of Industrial & Systems Engineering
200 W Packer Ave, Bethlehem PA 18015.
phone: 610-758-3865 fax: 610-758-4886
email: belotti at lehigh.edu
web: http://www.lehigh.edu/~pib208
On 01/04/2010, Pete Janes <ppjanes at gmail.com> wrote:
> Dear Pietro
>
> I am currently modifying Couenne, so that it can handle a multi-dimensional
> integral term,
> I want to manually obtain parameter values defined in the AMPL problem
> instance, ie. "param x := 1".
> Do you know how to access the data structure containing these values.
>
> I am trying to avoid modifying the ASL library, by "hijacking" the MIN(x,y)
> function and using it
> to represent my integral function. The integral is defined by one variable,
> and many parameters,
> so the first argument is the variable, and the second argument is intended
> to point to a set of
> parameter values.
>
> Do you know how I can solve this problem?
>
> Happy New Year,
>
> Pete
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
More information about the Couenne
mailing list