[AMPL 1813] Using variable solution in model expression

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

[AMPL 1813] Using variable solution in model expression

by bbmdavid :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

I would like to write a constraint containing an expression with the
value of a variable from a prior solve.
I don't want to define a new parameter to transfer the solution to the
next solve, can I use user defined suffix for that?

For example:

suffix initial;

var X;

subject to test: X>=1+X.initial;
minize obj:X;

let X.initial := 0;
solve;
(>>X=1)
let X.initial := X.val;
solve;
(>>X=2)

This works on this simple example, but in a more complex model, using
user defined suffix inside model expression causes ampl to crash!

Thanks, Benoit.




--~--~---------~--~----~------------~-------~--~----~
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 1814] Re: Using variable solution in model expression

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



If AMPL crashes, then there must be a bug of some sort.  Can you send an
example of the output that you're seeing when the crash occurs, plus
whatever files are needed for us to reproduce the problem?

Bob Fourer
4er@...


> -----Original Message-----
> From: ampl@... [mailto:ampl@...] On Behalf Of
> bbmdavid@...
> Sent: Tuesday, June 03, 2008 2:34 AM
> To: AMPL Modeling Language
> Subject: [AMPL 1813] Using variable solution in model expression
>
>
> Hi,
>
> I would like to write a constraint containing an expression with the
> value of a variable from a prior solve.
> I don't want to define a new parameter to transfer the solution to the
> next solve, can I use user defined suffix for that?
>
> For example:
>
> suffix initial;
>
> var X;
>
> subject to test: X>=1+X.initial;
> minize obj:X;
>
> let X.initial := 0;
> solve;
> (>>X=1)
> let X.initial := X.val;
> solve;
> (>>X=2)
>
> This works on this simple example, but in a more complex model, using
> user defined suffix inside model expression causes ampl to crash!
>
> Thanks, Benoit.
>
>
>
>
>


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price