help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] [Fwd: Ceil in minimize function -- invalid type error (m


From: Andrew Makhorin
Subject: Re: [Help-glpk] [Fwd: Ceil in minimize function -- invalid type error (mod file in attachment)]
Date: Thu, 19 Jan 2017 13:44:06 +0300

> 
> I'm not sure, if I correctyl understood the second way. When I try to
> add a new integer var:
> var Z{a in Art, s in Supp}, integer, >= 0;
> 
> 
> 
> and in goal function try to minimize sume of order cost + delivery
> cost:
> minimize goal: sum{a in Art,s in Supp} ((OrdQty[a,s] * Prices[a,s]) +
> Z[a,s]);
> 
> 
> I'm not sure how to calculate the Z elements with the formula
> Z[a,s] = (ceil(OrdQty[a,s]/ArtPackQty[a])*DeliveryCost[a,s]);  /* how
> to model it in the file? */
> 
> 
> 
> Is it that what you suggested, or I don't understand it ?
> 

I mean the following:

s.t. foo{a in Art, s in Supp} : Z[a,s] >= OrdQty[a,s]/ArtPackQty[a];
/* due to minimization you may think this inequality as equality
   Z[a,s] = ceil(OrdQty[a,s]/ArtPackQty[a]) */

minimize goal: sum{a in Art,s in Supp} ((OrdQty[a,s] * Prices[a,s])+
        (Z[a,s]*DeliveryCost[a,s]);






reply via email to

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