RE: [AMPL 7149] Bad suffix .sensobjlo & .sensobjhi

87 views
Skip to first unread message

Robert Fourer

unread,
Jun 13, 2013, 10:17:14 AM6/13/13
to am...@googlegroups.com

.sensobjlo and .sensobjhi are solver-defined suffixed, so they aren't created until after the first "solve" of your script.  But when AMPL encounters a "for" loop it immediately parses everything in the loop; thus it encounters these suffixes and complains that they aren't defined yet.  Thus you'll need to define these suffixes yourself,

 

   suffix sensobjlo OUT;

   suffix sensobjhi OUT;

 

before the beginning of the loop.

 

Bob Fourer

am...@googlegroups.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of Tim S
Sent: Wednesday, June 12, 2013 2:28 PM
To: am...@googlegroups.com
Subject: [AMPL 7149] Bad suffix .sensobjlo & .sensobjhi

 

Hello,

I have the following problem:

 

. . .

 

RUN FILE "run.run":

 

model model.mod;

data data.dat;

 

for {i in D}

{

            solve Prob1[i];

            let x[i]:= DMweights[i];

 

display i> results;

 

display u.sensobjlo > results;

 

display u.sensobjhi > results;

 

}

 

When I run the following problem in AMPL, I get the errors "Bad suffix .sensobjlo for u" and "Bad suffix .sensobjhi for u". I was wondering why this might be. 

 

Thanks, 

 

Tim

 

Tim S

unread,
Jun 13, 2013, 4:32:04 PM6/13/13
to am...@googlegroups.com, 4...@ampl.com
Thanks Bob!
Reply all
Reply to author
Forward
0 new messages