help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Rewriting AMPL ordered set


From: Joey Rios
Subject: [Help-glpk] Rewriting AMPL ordered set
Date: Fri, 13 Jul 2007 10:56:18 -0700

Hello,

I am trying to port an AMPL model over to GLPK.  My model has ordered sets.

Searching through these help archives I found Andrew's work around for ordered sets:

set S;
param ref{i in 1..card(S)}, symbolic, in S;
param a{S};
# now a[ref[i]] refers to the ith element of S.

OK, most of that makes sense to me (except the symbolic part... if anyone can explain that in this context, it would be a bonus!).

Now in my model, the problem is my set is two-dimensional.  It looks like this:

set FP {FLIGHTS} ordered within SECTORS;

Where FP is a flight plan and is inherently ordered.  Basically, there are x FPs which are ordered lists of SECTORS (where 'x' is the number of flights).  The length of the FPs is not constant.

So my question is how the syntax would look for this in GLPK?  Everything I try is wrong.  I'm not the best AMPL coder, so this is abstracting things a too far for me.  Hopefully there is a simple-ish solution?  If any further information from me is helpful, just let me know.  Any advice/guidance appreciated.

Thanks.


See what you’re getting into…before you go there. Check it out!
reply via email to

[Prev in Thread] Current Thread [Next in Thread]