Re: [Fwd: Ceil in minimize function -- invalid type error (mod file in attachment)]

Andrew Makhorin <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <1484822646.3922.4.camel@corvax>
> 
> 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]);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.