AMPL duplicate member "x" for set "y", how to fix it

Ares_Inglada_Grano
Wed, 05 Apr 2023 08:55:53 +0000
Support

I 'm working with AMPL. In the “.mod” I have declared a set like this: set path_intersections; It consists of rows of two numbers, the first one is the number of the path, and the second one the number of the intersection, in the .dat it looks like this:

set path_intersections:=
1439 5
1439 74243
1441 5
1441 89
1441 90
... ;

With 200 rows. Obviously, each path has more than 1 intersection, but when I run it, i get this

error:
practica.dat, line 605 (offset 9912):
    duplicate member 1439 for set path_intersections
context:   >>> ; <<<

practica.dat, line 605 (offset 9912):
    duplicate member 1439 for set path_intersections
context:   >>> ; <<<
...

How can I fix it so that it doesn’t take it as a duplicate? Every path has got more than one intersection, they are not duplicated.

Thank you!

4 posts - 2 participants