[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Unreferenced Out of Domain Error
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Unreferenced Out of Domain Error |
Date: |
Sat, 08 Dec 2012 13:56:27 +0400 |
> Thanks for your response.
> I entered the debugging statement you suggested; the triplet
> (314,2,17) does not get printed, but an attempt is still made to
> access Stand_Type[314,2,17] when it gets to:
>
> sum { i in stands, j in pres[char_stand[i], t in 0..19 } Stand_Type[i,j,t].
>
> I don't know what to make of it.
>
I tried to reproduce the effect (see below). As you can see,
Stand_Type[314,2,17] is *not* referenced; otherwise, this would cause a
zero divide error. Please check your model and data more carefully;
maybe that parameter member is referenced somewhere else.
Andrew Makhorin
set stands;
set pres{0..1};
param char_stand{stands};
display stands, pres, char_stand;
param Stand_Type{i in stands, j in 1..1000, t in 0..19} :=
if i = 314 and j = 2 and t = 17 then 1 / 0 else 1;
display sum{ i in stands, j in pres[char_stand[i]], t in 0..19 }
Stand_Type[i,j,t];
data;
set stands := 300, 314, 350;
set pres[0] := 1, 101, 102;
set pres[1] := 1, 2, 3, 4, 5, 6;
param char_stand := [300] 1, [314] 0, [350] 1;
end;
GLPSOL: GLPK LP/MIP Solver, v4.48
Parameter(s) specified in the command line:
--check -m test.mod --log test.log
Reading model section from test.mod...
Reading data section from test.mod...
20 lines were read
Display statement at line 5
stands:
300
314
350
pres[0]:
1
101
102
pres[1]:
1
2
3
4
5
6
char_stand[300] = 1
char_stand[314] = 0
char_stand[350] = 1
Display statement at line 10
300
Model has been successfully generated