Patent ID: 7636670

Claim:
A method comprising: receiving a total quantity value; receiving a plurality of distribution rules for distributing the total quantity value to a plurality of product types, each distribution rule to govern a separate characteristic of the plurality of product types; applying the plurality of distribution rules to the total quantity value to derive a desired quantity value for each of the plurality of product types; rounding in a computer processor the desired quantity value for each of the plurality of product types to an integer when the desired quantity value is a non-integer, the rounding includes: maintaining the sum of the desired quantity values as equal to the total quantity value; approximating the plurality of distribution rules for each value of each separate characteristic as applied to the desired quantity values, taking into account, for the desired quantity value of a product type of the plurality of product types being rounded, rounding errors of desired quantity values rounded prior to the desired quantity value of the product type being rounded, wherein p characteristics of the plurality of product types span a p-dimensional space and each of the plurality of product types is defined as a point in the p-dimensional space, the point being determined by a combination of values for each of the p characteristics; calculating a difference function for each dimension, the difference function using previously rounded quantities; using the calculated difference functions when rounding the desired quantity value to an integer; and using a bounded rounding function f[x, y]=b_r[x, y]=r[x+max[−0.5, 0.5−ε; y]], wherein x is the desired quantity value and y is the sum of the calculated difference functions and ε is a small non-zero value depending on the precision of the number x, the maximum function max[x 1 , x 2 ; y] having the value of −0.5 when y is smaller than −0.5, the value y when y is between −0.5 and +0.5, and the value +0.5 when y is larger than +0.5; and applying the rounded desired quantity values to a production of products.