问题
In AMPL, I have a set which should store some similar values. But I have a "duplicate number" error.
Is there any way to do that? What is the simplest method to solve this problem?
The set is:
set A;
data: set A := 1 1 2;
Thanks
回答1:
Set elements should be unique in AMPL. To store duplicate values use parameter instead:
set S;
param A{S};
data;
param:
S: A :=
1 1
2 1
3 2;
来源:https://stackoverflow.com/questions/26739400/ampl-error-duplicate-number-for-set