[AMPL 2109] programming an algorithmus for the mulit-level-capazitated-lot-sizing-problem (MLCLSP)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 2109] programming an algorithmus for the mulit-level-capazitated-lot-sizing-problem (MLCLSP)

Marc-139

Hi everybody,

i am confronted with the task to programm an algorithmus which solve
the MLCLSP ( a so called fix and optimize algotihmus). My question is
if anybody got experience with the MLCLSP. I've bought the ampl book
and some of the problems are close but not close enough. This will be
a hard job for me, but i hope here i can get a little support.

best regards
Marc

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2111] Re: programming an algorithmus for the mulit-level-capazitated-lot-sizing-problem (MLCLSP)

Marc-139


ok,
for today i capitulate - please help!!!

i wrote this program and after ten error messages he's bailing out.
Example for error message was OC is not defined. Is it because i
didn't wrote the data sheet yet. Or is it completely wrong ??

#SETS#
set Prod;         #products (p and i)#
set Resourc;      #resources#
set ProdResourc;  #set of products requiring resource j#
set prodSucess;   #set of immediate successors of product p#


#PARAMETERS#
param T > 0                    #periods#
param a {Prod} >= 0;           #number of units of product p required
to produce one unit of   product i#
param b {Resourc,1..T} >= 0;   #available capacity of resource j in
period t#
param B >= 0;                  #Big Number#
param d {Prod,1..T} >= 0;      #external demand of prdouct p in period
t#
param h {Prod} >= 0;           #holding cost of product p per unit and
period#
param oc {Resourc,1..T} >= 0;  #overtimecost per unit of overtime at
resource j in period t#
param s {Prod} >= 0;           #setup cost of product p#
param tp {Prod} >= 0;          #production time per unit of product p#
param ts {Prod} >= 0;          #setup time of product p#
param z {Prod} >= 0;           #planned lead time of product p#
param inv0 {Prod} >= 0;        #inital inventory#

#DECISION VARIABLES#
var O {Resourc,1..T} >= 0;     #Overtime at resource j in period t#
var Q {Prod,1..T} >= 0;        #production quantity (ot size) of
product p in period t#
var Y {Prod,1..T} >= 0;        #planned end-of-period inventory of
product p in period t#
var use {Prod,1..T} binary;    #binary setup variable of product p in
period t#

#OBJECTIVE CONSTRUCTION#
minimize Total_Cost:
sum{p in Prod,t in 1..T}(s[p]*use[p,t]+h[p]*Y[p,t]) + sum{j in
Resourc,t in 1..T} OC[j,t]*O[j,t];

#INITIAL INVENTORY CONSTRAINTS#
subject to Init_Inv {p in Prod}:
Y[p,0] = inv0[p];

#BALANCE INVENTORY CONSTRAINTS#
subject to Balance {p in Prod, t in 1..T}:
Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
= d[p,t];

#RESOURCE CAPACITY CONSTRAINT#
subject to Cap_Con:
sum{p in ProdResourc}(tp[p]*Q[p,t] + ts[p]*use[p,t]) <= b[j,t] + O
[j,t];

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2112] Re: programming an algorithmus for the mulit-level-capazitated-lot-sizing-problem (MLCLSP)

Robert Fourer-2


Indeed, OC is not defined.  It's true that param oc is defined, but in AMPL oc
is not the same as OC.

It would also help to put a semicolon at the end of the statement "param T >
0".

Comments in AMPL are not delimited by # signs.  A comment is everything from a
# character to the end of the line, or everything (possibly several lines)
beginning with /* and ending with */ .


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of Marc
> Sent: Thursday, December 04, 2008 11:59 AM
> To: AMPL Modeling Language
> Subject: [AMPL 2111] Re: programming an algorithmus for the mulit-level-
> capazitated-lot-sizing-problem (MLCLSP)
>
>
>
> ok,
> for today i capitulate - please help!!!
>
> i wrote this program and after ten error messages he's bailing out.
> Example for error message was OC is not defined. Is it because i
> didn't wrote the data sheet yet. Or is it completely wrong ??
>
> #SETS#
> set Prod;         #products (p and i)#
> set Resourc;      #resources#
> set ProdResourc;  #set of products requiring resource j#
> set prodSucess;   #set of immediate successors of product p#
>
>
> #PARAMETERS#
> param T > 0                    #periods#
> param a {Prod} >= 0;           #number of units of product p required
> to produce one unit of   product i#
> param b {Resourc,1..T} >= 0;   #available capacity of resource j in
> period t#
> param B >= 0;                  #Big Number#
> param d {Prod,1..T} >= 0;      #external demand of prdouct p in period
> t#
> param h {Prod} >= 0;           #holding cost of product p per unit and
> period#
> param oc {Resourc,1..T} >= 0;  #overtimecost per unit of overtime at
> resource j in period t#
> param s {Prod} >= 0;           #setup cost of product p#
> param tp {Prod} >= 0;          #production time per unit of product p#
> param ts {Prod} >= 0;          #setup time of product p#
> param z {Prod} >= 0;           #planned lead time of product p#
> param inv0 {Prod} >= 0;        #inital inventory#
>
> #DECISION VARIABLES#
> var O {Resourc,1..T} >= 0;     #Overtime at resource j in period t#
> var Q {Prod,1..T} >= 0;        #production quantity (ot size) of
> product p in period t#
> var Y {Prod,1..T} >= 0;        #planned end-of-period inventory of
> product p in period t#
> var use {Prod,1..T} binary;    #binary setup variable of product p in
> period t#
>
> #OBJECTIVE CONSTRUCTION#
> minimize Total_Cost:
> sum{p in Prod,t in 1..T}(s[p]*use[p,t]+h[p]*Y[p,t]) + sum{j in
> Resourc,t in 1..T} OC[j,t]*O[j,t];
>
> #INITIAL INVENTORY CONSTRAINTS#
> subject to Init_Inv {p in Prod}:
> Y[p,0] = inv0[p];
>
> #BALANCE INVENTORY CONSTRAINTS#
> subject to Balance {p in Prod, t in 1..T}:
> Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> = d[p,t];
>
> #RESOURCE CAPACITY CONSTRAINT#
> subject to Cap_Con:
> sum{p in ProdResourc}(tp[p]*Q[p,t] + ts[p]*use[p,t]) <= b[j,t] + O
> [j,t];
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2115] Re: programming an algorithmus for the mulit-level-capazitated-lot-sizing-problem (MLCLSP)

Marc-139

Hallo, my model has got a constraint:

Q[p,t-z[p]] ,where z is planned lead time of product p. I think this
formulation (with two braces) won`t work in ampl, doesn`t it? The hole
constraint looks like this:

#BALANCE INVENTORY CONSTRAINTS
> > subject to Balance {p in Prod, t in 1..T}:
> > Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> > = d[p,t];

The idea is that a production quantity of product p in period t - z[p]
is available in period t to satisfy the external demand d[p,t] or to
be used in the production of a succeding product i.









On 4 Dez., 21:20, "Robert Fourer" <[hidden email]> wrote:

> Indeed, OC is not defined.  It's true that param oc is defined, but in AMPL oc
> is not the same as OC.
>
> It would also help to put a semicolon at the end of the statement "param T >
> 0".
>
> Comments in AMPL are not delimited by # signs.  A comment is everything from a
> # character to the end of the line, or everything (possibly several lines)
> beginning with /* and ending with */ .
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]]
> > On Behalf Of Marc
> > Sent: Thursday, December 04, 2008 11:59 AM
> > To: AMPL Modeling Language
> > Subject: [AMPL 2111] Re: programming an algorithmus for the mulit-level-
> > capazitated-lot-sizing-problem (MLCLSP)
>
> > ok,
> > for today i capitulate - please help!!!
>
> > i wrote this program and after ten error messages he's bailing out.
> > Example for error message was OC is not defined. Is it because i
> > didn't wrote the data sheet yet. Or is it completely wrong ??
>
> > #SETS#
> > set Prod;         #products (p and i)
> > set Resourc;      #resources
> > set ProdResourc;  #set of products requiring resource j
> > set prodSucess;   #set of immediate successors of product p
>
> > #PARAMETERS#
> > param T > 0;                   #periods
> > param a {Prod} >= 0;           #number of units of product p required
> >                                #to produce one unit of   product i
> > param b {Resourc,1..T} >= 0;   #available capacity of resource j in
> >                                #period t
> > param B >= 0;                  #Big Number
> > param d {Prod,1..T} >= 0;      #external demand of prdouct p in period
> >                                #t
> > param h {Prod} >= 0;           #holding cost of product p per unit and
> >                                #period
> > param OC {Resourc,1..T} >= 0;  #overtimecost per unit of overtime at
> >                                #resource j in period t
> > param s {Prod} >= 0;           #setup cost of product p
> > param tp {Prod} >= 0;          #production time per unit of product p
> > param ts {Prod} >= 0;          #setup time of product p
> > param z {Prod} >= 0;           #planned lead time of product p
> > param inv0 {Prod} >= 0;        #inital inventory
>
> > #DECISION VARIABLES#
> > var O {Resourc,1..T} >= 0;     #Overtime at resource j in period t
> > var Q {Prod,1..T} >= 0;        #production quantity (ot size) of
> >                                #product p in period t
> > var Y {Prod,1..T} >= 0;        #planned end-of-period inventory of
> >                                #product p in period t
> > var use {Prod,1..T} binary;    #binary setup variable of product p in
> >                                #period t
>
> > #OBJECTIVE CONSTRUCTION
> > minimize Total_Cost:
> > sum{p in Prod,t in 1..T}(s[p]*use[p,t]+h[p]*Y[p,t]) + sum{j in
> > Resourc,t in 1..T} OC[j,t]*O[j,t];
>
> > #INITIAL INVENTORY CONSTRAINTS
> > subject to Init_Inv {p in Prod}:
> > Y[p,0] = inv0[p];
>
> > #BALANCE INVENTORY CONSTRAINTS
> > subject to Balance {p in Prod, t in 1..T}:
> > Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> > = d[p,t];
>
> > #RESOURCE CAPACITY CONSTRAINT
> > subject to Cap_Con:
> > sum{p in ProdResourc}(tp[p]*Q[p,t] + ts[p]*use[p,t]) <= b[j,t] + O
> > [j,t];
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2119] Re: programming an algorithmus for the mulit-level-capazitated-lot-sizing-problem (MLCLSP)

Robert Fourer-2


You can write Q[p,t-z[p]] if z is a parameter,
but not if z is a variable.

Bob Fourer
[hidden email]


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Marc
> Sent: Sunday, December 07, 2008 6:33 AM
> To: AMPL Modeling Language
> Subject: [AMPL 2115] Re: programming an algorithmus for the mulit-level-
> capazitated-lot-sizing-problem (MLCLSP)
>
>
> Hallo, my model has got a constraint:
>
> Q[p,t-z[p]] ,where z is planned lead time of product p. I think this
> formulation (with two braces) won`t work in ampl, doesn`t it? The hole
> constraint looks like this:
>
> #BALANCE INVENTORY CONSTRAINTS
> > > subject to Balance {p in Prod, t in 1..T}:
> > > Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> > > = d[p,t];
>
> The idea is that a production quantity of product p in period t - z[p]
> is available in period t to satisfy the external demand d[p,t] or to
> be used in the production of a succeding product i.
>
>
>
>
> On 4 Dez., 21:20, "Robert Fourer" <[hidden email]> wrote:
> > Indeed, OC is not defined.  It's true that param oc is defined, but in
> AMPL oc
> > is not the same as OC.
> >
> > It would also help to put a semicolon at the end of the statement "param
> T >
> > 0".
> >
> > Comments in AMPL are not delimited by # signs.  A comment is everything
> from a
> > # character to the end of the line, or everything (possibly several
> lines)
> > beginning with /* and ending with */ .
> >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]]
> > > On Behalf Of Marc
> > > Sent: Thursday, December 04, 2008 11:59 AM
> > > To: AMPL Modeling Language
> > > Subject: [AMPL 2111] Re: programming an algorithmus for the mulit-
> level-
> > > capazitated-lot-sizing-problem (MLCLSP)
> >
> > > ok,
> > > for today i capitulate - please help!!!
> >
> > > i wrote this program and after ten error messages he's bailing out.
> > > Example for error message was OC is not defined. Is it because i
> > > didn't wrote the data sheet yet. Or is it completely wrong ??
> >
> > > #SETS#
> > > set Prod;         #products (p and i)
> > > set Resourc;      #resources
> > > set ProdResourc;  #set of products requiring resource j
> > > set prodSucess;   #set of immediate successors of product p
> >
> > > #PARAMETERS#
> > > param T > 0;                   #periods
> > > param a {Prod} >= 0;           #number of units of product p required
> > >                                #to produce one unit of   product i
> > > param b {Resourc,1..T} >= 0;   #available capacity of resource j in
> > >                                #period t
> > > param B >= 0;                  #Big Number
> > > param d {Prod,1..T} >= 0;      #external demand of prdouct p in period
> > >                                #t
> > > param h {Prod} >= 0;           #holding cost of product p per unit and
> > >                                #period
> > > param OC {Resourc,1..T} >= 0;  #overtimecost per unit of overtime at
> > >                                #resource j in period t
> > > param s {Prod} >= 0;           #setup cost of product p
> > > param tp {Prod} >= 0;          #production time per unit of product p
> > > param ts {Prod} >= 0;          #setup time of product p
> > > param z {Prod} >= 0;           #planned lead time of product p
> > > param inv0 {Prod} >= 0;        #inital inventory
> >
> > > #DECISION VARIABLES#
> > > var O {Resourc,1..T} >= 0;     #Overtime at resource j in period t
> > > var Q {Prod,1..T} >= 0;        #production quantity (ot size) of
> > >                                #product p in period t
> > > var Y {Prod,1..T} >= 0;        #planned end-of-period inventory of
> > >                                #product p in period t
> > > var use {Prod,1..T} binary;    #binary setup variable of product p in
> > >                                #period t
> >
> > > #OBJECTIVE CONSTRUCTION
> > > minimize Total_Cost:
> > > sum{p in Prod,t in 1..T}(s[p]*use[p,t]+h[p]*Y[p,t]) + sum{j in
> > > Resourc,t in 1..T} OC[j,t]*O[j,t];
> >
> > > #INITIAL INVENTORY CONSTRAINTS
> > > subject to Init_Inv {p in Prod}:
> > > Y[p,0] = inv0[p];
> >
> > > #BALANCE INVENTORY CONSTRAINTS
> > > subject to Balance {p in Prod, t in 1..T}:
> > > Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> > > = d[p,t];
> >
> > > #RESOURCE CAPACITY CONSTRAINT
> > > subject to Cap_Con:
> > > sum{p in ProdResourc}(tp[p]*Q[p,t] + ts[p]*use[p,t]) <= b[j,t] + O
> > > [j,t];
> >
> >
>
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2124] Re: programming an algorithmus for the mulit-level-capazitated-lot-sizing-problem (MLCLSP)

timo.hilger

Hello Marc,

If you are a beginner with ampl, I would recommand that you first
programm a basic MLCLSP model (without overtime cost, leadtimes...).
If you see, that your model works you can extend your model and
restrictions.
You wrote that you want to implement an fix and optimize heuristic?! I
think for this project it would also be easier to have an small model
with an exact solution. So you can easier check the correctness of
your heuristc results.

best regards


On 8 Dez., 10:32, "Robert Fourer" <[hidden email]> wrote:

> You can write Q[p,t-z[p]] if z is a parameter,
> but not if z is a variable.
>
> Bob Fourer
> [hidden email]
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > Marc
> > Sent: Sunday, December 07, 2008 6:33 AM
> > To: AMPL Modeling Language
> > Subject: [AMPL 2115] Re: programming an algorithmus for the mulit-level-
> > capazitated-lot-sizing-problem (MLCLSP)
>
> > Hallo, my model has got a constraint:
>
> > Q[p,t-z[p]] ,where z is planned lead time of product p. I think this
> > formulation (with two braces) won`t work in ampl, doesn`t it? The hole
> > constraint looks like this:
>
> > #BALANCE INVENTORY CONSTRAINTS
> > > > subject to Balance {p in Prod, t in 1..T}:
> > > > Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> > > > = d[p,t];
>
> > The idea is that a production quantity of product p in period t - z[p]
> > is available in period t to satisfy the external demand d[p,t] or to
> > be used in the production of a succeding product i.
>
> > On 4 Dez., 21:20, "Robert Fourer" <[hidden email]> wrote:
> > > Indeed, OC is not defined.  It's true that param oc is defined, but in
> > AMPL oc
> > > is not the same as OC.
>
> > > It would also help to put a semicolon at the end of the statement "param
> > T >
> > > 0".
>
> > > Comments in AMPL are not delimited by # signs.  A comment is everything
> > from a
> > > # character to the end of the line, or everything (possibly several
> > lines)
> > > beginning with /* and ending with */ .
>
> > > > -----Original Message-----
> > > > From: [hidden email] [mailto:[hidden email]]
> > > > On Behalf Of Marc
> > > > Sent: Thursday, December 04, 2008 11:59 AM
> > > > To: AMPL Modeling Language
> > > > Subject: [AMPL 2111] Re: programming an algorithmus for the mulit-
> > level-
> > > > capazitated-lot-sizing-problem (MLCLSP)
>
> > > > ok,
> > > > for today i capitulate - please help!!!
>
> > > > i wrote this program and after ten error messages he's bailing out.
> > > > Example for error message was OC is not defined. Is it because i
> > > > didn't wrote the data sheet yet. Or is it completely wrong ??
>
> > > > #SETS#
> > > > set Prod;         #products (p and i)
> > > > set Resourc;      #resources
> > > > set ProdResourc;  #set of products requiring resource j
> > > > set prodSucess;   #set of immediate successors of product p
>
> > > > #PARAMETERS#
> > > > param T > 0;                   #periods
> > > > param a {Prod} >= 0;           #number of units of product p required
> > > >                                #to produce one unit of   product i
> > > > param b {Resourc,1..T} >= 0;   #available capacity of resource j in
> > > >                                #period t
> > > > param B >= 0;                  #Big Number
> > > > param d {Prod,1..T} >= 0;      #external demand of prdouct p in period
> > > >                                #t
> > > > param h {Prod} >= 0;           #holding cost of product p per unit and
> > > >                                #period
> > > > param OC {Resourc,1..T} >= 0;  #overtimecost per unit of overtime at
> > > >                                #resource j in period t
> > > > param s {Prod} >= 0;           #setup cost of product p
> > > > param tp {Prod} >= 0;          #production time per unit of product p
> > > > param ts {Prod} >= 0;          #setup time of product p
> > > > param z {Prod} >= 0;           #planned lead time of product p
> > > > param inv0 {Prod} >= 0;        #inital inventory
>
> > > > #DECISION VARIABLES#
> > > > var O {Resourc,1..T} >= 0;     #Overtime at resource j in period t
> > > > var Q {Prod,1..T} >= 0;        #production quantity (ot size) of
> > > >                                #product p in period t
> > > > var Y {Prod,1..T} >= 0;        #planned end-of-period inventory of
> > > >                                #product p in period t
> > > > var use {Prod,1..T} binary;    #binary setup variable of product p in
> > > >                                #period t
>
> > > > #OBJECTIVE CONSTRUCTION
> > > > minimize Total_Cost:
> > > > sum{p in Prod,t in 1..T}(s[p]*use[p,t]+h[p]*Y[p,t]) + sum{j in
> > > > Resourc,t in 1..T} OC[j,t]*O[j,t];
>
> > > > #INITIAL INVENTORY CONSTRAINTS
> > > > subject to Init_Inv {p in Prod}:
> > > > Y[p,0] = inv0[p];
>
> > > > #BALANCE INVENTORY CONSTRAINTS
> > > > subject to Balance {p in Prod, t in 1..T}:
> > > > Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> > > > = d[p,t];
>
> > > > #RESOURCE CAPACITY CONSTRAINT
> > > > subject to Cap_Con:
> > > > sum{p in ProdResourc}(tp[p]*Q[p,t] + ts[p]*use[p,t]) <= b[j,t] + O
> > > > [j,t];
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2129] Re: programming an algorithmus for the mulit-level-capazitated-lot-sizing-problem (MLCLSP)

Marc-139

Yes you're right!  Thanks for your advice.

On 11 Dez., 22:23, [hidden email] wrote:

> Hello Marc,
>
> If you are a beginner with ampl, I would recommand that you first
> programm a basic MLCLSP model (without overtime cost, leadtimes...).
> If you see, that your model works you can extend your model and
> restrictions.
> You wrote that you want to implement an fix and optimize heuristic?! I
> think for this project it would also be easier to have an small model
> with an exact solution. So you can easier check the correctness of
> your heuristc results.
>
> best regards
>
> On 8 Dez., 10:32, "Robert Fourer" <[hidden email]> wrote:
>
> > You can write Q[p,t-z[p]] if z is a parameter,
> > but not if z is a variable.
>
> > Bob Fourer
> > [hidden email]
>
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]] On Behalf Of
> > > Marc
> > > Sent: Sunday, December 07, 2008 6:33 AM
> > > To: AMPL Modeling Language
> > > Subject: [AMPL 2115] Re: programming an algorithmus for the mulit-level-
> > > capazitated-lot-sizing-problem (MLCLSP)
>
> > > Hallo, my model has got a constraint:
>
> > > Q[p,t-z[p]] ,where z is planned lead time of product p. I think this
> > > formulation (with two braces) won`t work in ampl, doesn`t it? The hole
> > > constraint looks like this:
>
> > > #BALANCE INVENTORY CONSTRAINTS
> > > > > subject to Balance {p in Prod, t in 1..T}:
> > > > > Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> > > > > = d[p,t];
>
> > > The idea is that a production quantity of product p in period t - z[p]
> > > is available in period t to satisfy the external demand d[p,t] or to
> > > be used in the production of a succeding product i.
>
> > > On 4 Dez., 21:20, "Robert Fourer" <[hidden email]> wrote:
> > > > Indeed, OC is not defined.  It's true that param oc is defined, but in
> > > AMPL oc
> > > > is not the same as OC.
>
> > > > It would also help to put a semicolon at the end of the statement "param
> > > T >
> > > > 0".
>
> > > > Comments in AMPL are not delimited by # signs.  A comment is everything
> > > from a
> > > > # character to the end of the line, or everything (possibly several
> > > lines)
> > > > beginning with /* and ending with */ .
>
> > > > > -----Original Message-----
> > > > > From: [hidden email] [mailto:[hidden email]]
> > > > > On Behalf Of Marc
> > > > > Sent: Thursday, December 04, 2008 11:59 AM
> > > > > To: AMPL Modeling Language
> > > > > Subject: [AMPL 2111] Re: programming an algorithmus for the mulit-
> > > level-
> > > > > capazitated-lot-sizing-problem (MLCLSP)
>
> > > > > ok,
> > > > > for today i capitulate - please help!!!
>
> > > > > i wrote this program and after ten error messages he's bailing out.
> > > > > Example for error message was OC is not defined. Is it because i
> > > > > didn't wrote the data sheet yet. Or is it completely wrong ??
>
> > > > > #SETS#
> > > > > set Prod;         #products (p and i)
> > > > > set Resourc;      #resources
> > > > > set ProdResourc;  #set of products requiring resource j
> > > > > set prodSucess;   #set of immediate successors of product p
>
> > > > > #PARAMETERS#
> > > > > param T > 0;                   #periods
> > > > > param a {Prod} >= 0;           #number of units of product p required
> > > > >                                #to produce one unit of   product i
> > > > > param b {Resourc,1..T} >= 0;   #available capacity of resource j in
> > > > >                                #period t
> > > > > param B >= 0;                  #Big Number
> > > > > param d {Prod,1..T} >= 0;      #external demand of prdouct p in period
> > > > >                                #t
> > > > > param h {Prod} >= 0;           #holding cost of product p per unit and
> > > > >                                #period
> > > > > param OC {Resourc,1..T} >= 0;  #overtimecost per unit of overtime at
> > > > >                                #resource j in period t
> > > > > param s {Prod} >= 0;           #setup cost of product p
> > > > > param tp {Prod} >= 0;          #production time per unit of product p
> > > > > param ts {Prod} >= 0;          #setup time of product p
> > > > > param z {Prod} >= 0;           #planned lead time of product p
> > > > > param inv0 {Prod} >= 0;        #inital inventory
>
> > > > > #DECISION VARIABLES#
> > > > > var O {Resourc,1..T} >= 0;     #Overtime at resource j in period t
> > > > > var Q {Prod,1..T} >= 0;        #production quantity (ot size) of
> > > > >                                #product p in period t
> > > > > var Y {Prod,1..T} >= 0;        #planned end-of-period inventory of
> > > > >                                #product p in period t
> > > > > var use {Prod,1..T} binary;    #binary setup variable of product p in
> > > > >                                #period t
>
> > > > > #OBJECTIVE CONSTRUCTION
> > > > > minimize Total_Cost:
> > > > > sum{p in Prod,t in 1..T}(s[p]*use[p,t]+h[p]*Y[p,t]) + sum{j in
> > > > > Resourc,t in 1..T} OC[j,t]*O[j,t];
>
> > > > > #INITIAL INVENTORY CONSTRAINTS
> > > > > subject to Init_Inv {p in Prod}:
> > > > > Y[p,0] = inv0[p];
>
> > > > > #BALANCE INVENTORY CONSTRAINTS
> > > > > subject to Balance {p in Prod, t in 1..T}:
> > > > > Y[p,t-1] + Q[p,t-z[p]] - sum{i in prodSucess} a[p,i] * Q[i,t] - Y[p,t]
> > > > > = d[p,t];
>
> > > > > #RESOURCE CAPACITY CONSTRAINT
> > > > > subject to Cap_Con:
> > > > > sum{p in ProdResourc}(tp[p]*Q[p,t] + ts[p]*use[p,t]) <= b[j,t] + O
> > > > > [j,t];
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---