Data formatting errors, "Item(s) missing on last row" and "duplicate set"

49 views
Skip to first unread message

Justin Thakar

unread,
Dec 9, 2020, 10:55:43 PM12/9/20
to AMPL Modeling Language
Hey,

So apparently data like this is making AMPL mad. It's apparently delineating a row at 138 or some other value when it shouldn't, and then SAYING it "2 items are missing from the last line of table!" or "Duplicate items in set!" even though every line supposedly should be letting AMPL know it has a unique ID. I'm not sure it's recognizing that the line starts at the leftmost ID number, I think it might be for some horrendous reason thinking it starts at 138 for some of the lines. 

These are the pertinent sections of code: 


set BUS;    # set of buses
set BRANCH; # set of branches
set GEND;   # Gen Data

#Bus Data
param bus_id {BUS};
param bus_num {BUS}; # Bus Number
param bus_Pd {BUS}; # Real Power Demand
param bus_kV {BUS}; 
param bus_costpermile {BUS};

...

data;

param: BUS: bus_id bus_num bus_Pd bus_kV bus_costpermile:= include busMINE.dat;
param: GEND: gen_id gen_num gen_Pmax gen_Cost:= include genMINE.dat;
param: BRANCH: branch_id branch_fbus branch_tbus branch_miles branch_R branch_X branch_B branch_Q branch_costpermile := include branchMINE.dat;
#param: LOAD: load_num load_ := include loadMINE.dat;

...


busMINE.dat, a few lines of:

1 101 324 138 300000
2 102 291 138 300000
3 103 540 138 300000
4 104 222 138 300000
5 105 213 138 300000
6 106 408 138 300000
7 107 375 138 300000
8 108 513 138 300000
9 109 525 138 300000
project.rar
UC.mod
Reply all
Reply to author
Forward
0 new messages