1 item(s) missing in last line of table, which starts with "280.67"

1,563 views
Skip to first unread message

José Mavungo

unread,
Mar 24, 2014, 9:01:04 AM3/24/14
to am...@googlegroups.com
hi I haven´t this error message 
"1 item(s) missing in last line of table, which starts with "280.67" "
my code looks like this:
file.mod

set T ordered;


param s{T};

...


file.data

set T := 1..257;

param: s := 255.94 258.63 258.89 261.07 243.40 247.49 245.42 245.81 245.88 252.05 251.88 249.32 242.63 243.14 246.50 252.17 249.57 249.38 253.29 257.07 255.04 255.57 252.21 252.21 250.96 249.10 251.72 256.66 255.95 257.63 259.83 259.21 257.91 261.61 265.64 265.02 264.43 261.58 262.46 267.82 267.22 267.98 267.88 267.30 267.38 269.43 269.06 263.84 264.94 266.37 266.13 268.65 271.22 271.12 268.74 268.84 268.91 263.35 258.51 258.06 260.07 258.07 258.89 256.09 258.51 265.49 266.16 269.43 270.16 271.37 271.57 259.75 259.77 259.21 257.92 256.13 256.42 260.14 262.46 263.93 263.80 262.61 261.33 261.56 263.00 260.32 258.79 257.48 256.54 257.62 253.31 253.85 256.78 258.71 255.39 251.35 252.57 253.02 250.83 253.51 253.76 254.63 253.42 262.16 266.69 265.33 266.45 267.05 265.17 271.52 270.20 271.26 271.43 274.30 274.45 269.77 270.68 268.94 271.67 275.66 274.82 273.78 269.06 272.31 270.98 273.50 271.78 275.81 272.02 271.78 270.02 270.55 267.85 269.32 270.26 272.05 270.51 268.47 270.00 266.66 263.50 264.68 265.19 262.50 266.02 272.02 272.21 272.06 272.98 271.93 271.15 269.98 266.49 261.90 262.75 262.55 258.69 260.56 260.77 261.03 260.24 256.98 257.09 261.13 259.18 259.68 262.33 262.51 261.52 258.35 264.48 265.59 265.87 265.88 266.84 266.47 267.43 269.31 268.13 270.65 268.82 269.73 270.16 269.18 269.76 268.88 268.26 269.08 272.59 271.91 271.38 270.62 271.86 272.39 278.07 278.24 277.93 273.98 275.22 275.50 276.41 279.38 276.97 282.88 283.66 282.28 282.38 281.38 277.28 278.53 278.97 279.06 279.06 279.20 276.31 273.93 275.15 273.33 273.69 267.92 267.72 268.34 263.82 264.60 266.47 266.22 267.21 269.00 267.23 268.64 270.91 273.70 272.49 271.81 274.93 277.59 278.13 276.57 277.03 276.52 276.31 275.31 274.28 276.29 278.91 277.47 277.38 276.87 277.87 276.83 277.08 279.40 277.72 275.31 279.43 280.01 280.67;


the idea is to initialise of set the values of s up.

fbahr

unread,
Mar 24, 2014, 11:09:45 AM3/24/14
to am...@googlegroups.com
It's not sufficient to provide the values parameter(s) s[t] shall take, you also need to give a mapping to the specific index t a value is assigned to.

I. e.,

param s := 1 255.94 <<... all the other (index,value) tuples ...>> 257 280.67;

--fbahr

Robert Fourer

unread,
Mar 26, 2014, 11:42:40 AM3/26/14
to am...@googlegroups.com
Also the statement "set T := 1..257;" should not appear in the data file. It is grammatically correct but does not produce the result expected. (It creates a set with one member, the string "1..257".) Instead I would recommend writing your model as

param nT integer > 0;
set T = 1..nT;

and then putting in your data

param nT := 257;

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com]
On Behalf Of José Mavungo
Sent: Monday, March 24, 2014 8:01 AM
To: am...@googlegroups.com
Subject: [AMPL 8268] 1 item(s) missing in last line of table, which starts with "280.67"

hi I haven´t this error message
"1 item(s) missing in last line of table, which starts with "280.67" "
my code looks like this:
file.mod
set T ordered;

param s{T};
...

file.data
set T := 1..257;
param: s := ...




Reply all
Reply to author
Forward
0 new messages