replace
ord2(blah)
with
ord2[blah]

Cheers
Yaron


On Mon, Feb 8, 2010 at 6:13 PM, Noli Sicad <[email protected]> wrote:

> I search the archive regarding this topic -ord
>
> Andrew's reply below but hard to understand.
>
> http://www.mail-archive.com/[email protected]/msg01281.html
>
> Anyway, I tried to reformulate based on how I understand it. Revised
> model below.
>
> It is still not working.
>
> Noli
>
> ~~~~~~~~~~
>
> # mrp.mod
> # AMPL: Data for mrp formulation
>
> set PP; # ordered;              # Set of SKU Numbers
> set TT; # ordered;              # Set of Time Buckets
>
> param ord1{i in PP, s in TT};
> param ord2{i in PP, t in TT};
>
> param P integer := card(PP); # Number of SKUs
> param T integer := card(TT); # Number of Time Buckets
> param M  >= 0;               # Large Number
>
> param LT {PP} integer;      # Lead Time
> param R  {PP,PP} integer;   # number of i to make one j
> param D {PP, TT} integer;   # External Demand for an item in a period
> param I {PP} integer;       # Beginning Inventory
> param LS {PP} integer;      # Lot Size
>
>
> var d {PP, TT} binary;      # production indicator
> var x {PP, TT} >=0;         # number of SKUs to produce
>
> # -----------------------------------------------------------------
>
> minimize objective: sum {i in PP, t in TT}
>                     (T-ord2(t)+1) * x[i,t];
>
> # -----------------------------------------------------------------
>
> subject to MaterialRequirement {i in PP, t in TT}:
>  (sum {s in TT: ord1(s) <= ord2(t)-LT[i] } x[i,s] )
>   + I[i]
>   - sum {s in TT: ord1(s)<=ord2(t)}
>         (D[i,s] + sum {j in PP} R[i,j]* x[j,s])
>   >= 0;
>
> subject to LotSize {i in PP, t in TT}:
>   x[i,t] - d[i,t]*LS[i] >= 0;
>
> subject to ProductionIndicator {i in PP, t in TT}:
>   d[i,t] - x[i,t]/M >=0;
>
> Error,
>
> GLPSOL: GLPK LP/MIP Solver, v4.42
> Parameter(s) specified in the command line:
>  --cover --clique --gomory --mir -m mrp_c3.mod
> Reading model section from mrp_c3.mod...
> mrp_c3.mod:28: function ord2 unknown
> Context:  minimize objective : sum { i in PP , t in TT } ( T - ord2 (
> MathProg model processing error
> >Exit code: 1    Time: 0.206
>
>
> _______________________________________________
> Help-glpk mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-glpk
>
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to