A METHOD AND AN APPARATUS FOR BATCHING ITEMS

Abstract: A method and an apparatus for weight controlled batching out of items having non-uniform weight. Items are assigned to a bin, based on a test fitting of real items with a known weight measure combined with a test fitting of imaginary items with imagined weight measures.

Description: A METHOD AND AN APPARATUS FOR BATCHING ITEMS Field of the Invention The present invention relates to methods for batching items of irregular weights into portions of a substantially uniform weight. In particular the invention relates to a method wherein items is assigned to a bin based on a test fitting of real items with a known weight measure combined with a test fitting of imaginary items with imagined weight measures. This enables an improved the uniformity of the portions without having to expand the number of real items with known weight measures. Description of the Prior Art One of the things that characterise food processing is the nature of the raw material. The raw material typically results in irregularities in size, shape and weight of items flowing through the processing system. Even though the raw material is mechanically cut into pieces of an intended size there are often great variations in size of the items. An example of this is the cutting of fish fillets into pieces. Frequently, at the end of the food processing lines, the items are collected into portions of a specified size. In most cases it is only the portion weight (in grams) that is specified, but other specifications could be included. For many market areas, it is required that the weight of each portion is never under the specified target weight. This means that, because of the irregularities in item weights, there will always be some overweight. The goal of the methods described here is to keep the overweight as low as possible with respect to the limits set by the required speed and the available information. In some cases this information is the weight of the next N incoming items and the fill status, or equivalents target shortage, of M open boxes or portion bins. M is usually a small number and could even be equal to 1. In other cases N = 1 , M > 1 and we have only statistical information about the weights of previous items that have already been packed. Usually the items arrive sequentially on a conveyor belt and pass an electronic scale that records the item weight and sends it to a computer. The time the computer has to decide which of the open bins should receive the item depends on the speed of the belt and the distance between the scale and the bin. If the distance from the scale to the bins is very small and the speed is high we have the case of N = 1 , i.e. we only know the weight of one item. We can increase N by moving the scale away from the bins. However this is often not possible because of physical constraints. Overweight may preferably be expressed in terms of how much a package weight exceeds a given minimum target weight. The items arrive in a sequence and must be dispatched into the bins very quickly. Only the first N item weights are known, N usual being a small number. A special case is N=1. Statistics is kept of the previous item weights. M bins are open at any time, a special case is M=1 (in which case N > 1 and one is not restricted to a given sequence of items and/or rejecting items is allowed). The problem that comes closest to our problem is known in the literature as "Bounded- Space Online Dual Bin Packing". There it is imaginary that M bins are open and N»1 items are known. Here however we focus our attention mainly on the case where N=1, or N is very small, and the batching decisions must be made very fast and sequentially based on previous item weight statistics. This is common in many food-manufacturing systems like for example fish processing. The problem in relation to the present invention differs from the above mentioned "Bounded-Space Online Dual Bin Packing" problem in the sense that in batching of items according to the present invention it is not possible - or at least not practical - to put items on hold which is a fundamental characteristic of the Packing methods. In these methods information relating to a large number of next arriving items is exploited to pack the items optimally which includes selection of the items in an order being different from the order they arrive in, i.e. the batching is not done sequentially. A technical problem in connection with batching of items is therefore that the items must be assigned either to a bin or a rejection position as they arrive. No information is available for a large number of next arriving items, so that the assigning may only be based on one item - or at least a few numbers of next arriving items. This problem becomes even bigger when the assigning takes place as a step included in processing of food, as the items next arriving item may not be provided when an item is to be assigned. Description of the Invention This problem has been solved by means of the present invention, which according to a first aspect provides a method for batching items by a measure, said method comprising the steps of: - by means of a grader, conveying a stream of items from an in-feed area to a grading area wherein at least one item batch is being formed and recording the measure of the items being conveyed, - forming imaginary combinations of items, said combinations comprising items selected from a pool A of items which measure have been recorded and items selected from a pool B of imaginary items, the forming of imaginary combinations comprising the steps of: - recording the measure of the batch and for each batch calculating a difference between a desired measure and the recorded measure, - generating a measure for the items of the pool B, - combining the pool of items A and the pool of items B into an imaginary pool of items, and - assigning combinations of the items selected from the imaginary pool of items to each batch, so that the measure of each batch fulfils a criteria for the batch (if such combinations exists), - evaluating the imaginary combinations for each batch with respect to a desired measure of the batch and optionally re-forming the imaginary combinations until the evaluation gives a satisfactory result, and - conveying the items to the batch they are assigned to. The grader could be of a regular type adapted for conveying food items from an in-feed area to a selected batch, the food items being conveyed e.g. on a regular conveyor belt. As the food items are being conveyed a measure is being determined and recorded for each food item. The measure could be the weight of the food items, the size of the food items, a specific colour or any other characteristics of the food related to a criterion for batching. The criterion for batching could as an example be to combine food items so that the weight of the batch of items are within a certain weight zone or so that the weight of the batch is as close as possible to a preferred weight zone. The criteria could also be related to the quality of the food items, e.g. to be determined from the colour of the food items. As an example the criteria could be that the food items of a certain criteria should be distributed as uniformly as possible, or that some batches should have all the items of a good quality while others should have all the items of a less good quality. The criteria could also be related to the size of specific food items or even be related to the shape of specific food items. The criterion may even be related to a number of dependent or independent measures of the batch or of the items included in the batch. As an example the criteria could be that the parts should have individual shapes and the total weight of the batch should be within a certain weight zone. This could be the case, e.g. for batching pieces from a chicken into a portion wherein the portion preferably should contain at least one of each part of a chicken i.e. at least one wing, one breast, one tender etc. The imaginary portions are portions which are defined without the food items being moved to an actual location of a portion. In fact the imaginary portions may exist for a very short moment until they have been evaluated based on the criteria for the batches. If they do ■ not fulfil a certain criteria, new imaginary portions may be formed. When a satisfactory result has been reached the items can be located so as to form real batches according to the imaginary portions. The items being used for forming the imaginary portions are taken from one pool of real items that have been measured and from another pool of imaginary items. The pool of imaginary items is defined by generating measures for that pool of items. The measures may be generated in various ways. As an example the measures may be generated based on knowledge of recorded measures of previous real items. According to a preferred embodiment of the invention the measure of the imaginary items may be generated by - selecting a number N of imaginary items to include in the pool B, and by - generating a measure of the selected number of imaginary items by dividing a known distribution of earlier weighed items into a number N of 100/N-percentile distributions and assigning a measure equal to the average of the lowest percentile to the first imaginary item, a measure equal to the average of the second lowest percentile to the next imaginary item etc. until all imaginary items have been assigned an imaginary measure. The known distribution of earlier weighed items could as an example include the last 100 recorded pieces or the last 1000 recorded pieces or even more than 10000 recorded pieces. As an example it may be chosen to generate a measure for a number N equal to 50 food items. To do so a known distribution including 10000 food items is divided into 50 2-percentile distributions and for each of the 50 2-percentile distributions a measure is defined as the average of the percentile. The number of items that it is necessary to include in the pool B of imaginary items could be found by: - calculating a sum of the differences between the desired measures and the recorded measures of all of the batches, and - dividing the sum with the average size of a sample of items. The sample of items could be the latest 100, 1000 or even the latest 10000 recorded items. As an example the batches being filled may be short of a total of 20 kilo. The average size of the latest 10000 recorded items was 0,5 kilo. Therefore at least 40 items should be included in the pool B of imaginary items. It may be necessary to add a small overhead. The overhead may be necessary due to the fact that some of the batches will always be overfilled or filled with items witch are not 100 percent suited for the batch. As an example 10 batches may be short of 20 kilo of meat. Some of these batches will be filled with more meat than necessary, e.g. due to the nature of pieces of meat having different size and weight. Therefore it may be necessary to use a number which in average provides e.g. 21 kilo of meat. The measure of the number N of items to include in the pool B of items could also be generated by: - selecting a number N of imaginary items to include in the pool B, - recording the measure of a number M≥N of items, and - generating the measure of the N imaginary items by assigning the measure of N items out of the M items to the imaginary items in the pool B. The measure of an imaginary item could also be generated by stochastically simulating the measure by the use of an empirical distribution of the previously recorded items and assigning the simulated measure to the imaginary item of the pool B. According to a preferred embodiment of the invention the assigning of combinations of the items of the imaginary item pool may comprise the steps of: - arranging the batches by the measure, - for one batch, selecting out of the total number of items, the combination of one or more items so that the measure of the batch fulfils the criteria (e.g. minimally over the minimum weight or closest possible to the desired weight), - assigning that combination to the batch, and - continue selecting combinations until all batches have been filled or until there are no more unassigned items. The selection of combinations may be done e.g. by Dynamic Programming, Enumeration - - just trying all combinations, Genetic Algorithm, Branch and Bounds Algorithms or by means of any Heuristic methods or by means of neural networks. The selection criterion could as an example be selection of combinations with a minimum overweight or selection of batches closest possible to a target weight, selection of batches with most equally distributed sizes of the items etc. As an example the batches could be arranged from the most filled batch to the least filled batch. After the batches have been arranged the selection of combinations may start with the most filled batch towards the least filled batch. As another example the batches may be arranged from the least filled batch to the most filled batch. According to a preferred embodiment of the invention the measure of the items is being recorded continuously as they are conveyed from the in-feet area to the grading area. The assigning of combinations of the items of the imaginary item pool preferably comprises the step of: - moving the first assigned item to the batch it was assigned to and redoing the assigning of combinations each time the measure of a new piece has been recorded. In this way an updated total shortage of all of the batches are taken into consideration each time the imaginary combinations are being assigned. If one of the batches reaches a desired target weight or a criteria for the batch in similar way is fulfilled, the batch may be emptied, and the assigning of combination may be redone on the basis of the new shortage situation for the batches. If a regular grader is being used it would typically be the case that the items are conveyed in a fixed sequence. According to a preferred embodiment of the invention the assigning of combinations of the items of the imaginary item pool comprises the steps of: - randomly choosing a combination for each batch so that the measure of each batch fulfils a criteria, and - evaluating the combination for each batch, on the basis of overweight, and/or shortages and using the methods of Genetics Algorithm to make a new combination on the basis of the existing combinations until a pre-specified criteria is fulfilled. When the assigning of combination actually fulfils the criterion set for the batches it may be worth to evaluate the batches before moving the items to the bins. As an example it may be worth to try to replace items and recalculate, e.g. if the total difference between the target weights of the bins and the actual weights of the bins may be lowered. A post processing method may therefore preferably be adapted after the assigning of the combinations. According to a second aspect the invention relates to a method for assigning at least one item having at least one characteristic property to a bin comprised in a group of bins comprising at least one bin, wherein requirement(s) having been made as to an allowable batch size of each bin in terms of for instance a filling zone, a group of items comprising pretended and optionally also detected items having been provided and characteristic property/properties of at least one item to be test-assigned having been provided. The requirements and group of items may suitable be viewed upon as the platform for the method. Providing of the platform should not be construed to limit the protection provided by the claims in the direction that the platform has to be provided as a separate step of the method as the platform may be provided as a step included in the general method according to the present invention. The requirements provided set for instance the maximum and minimum batch size of each bin and determine thereby the quality of the batching. Other useable requirements may preferably be the number of items in each bin for instance combined with size (for instance in meters) and weight of the bin. The platform further comprises a group of items, which mimic/represents characteristics of items to be assigned, on the basis of for instance earlier detected items, and atleast one item to be test assigned. As will become clear from the following, the item to be test- assigned is not necessarily divided from the group of item, but may just as be included into the group of items to be test-assigned. The only crucial feature in this connection is that characteristic properties/property of at least one items to be test-assigned must be provided. The item to be test-assigned is preferably the most recently detected item, which initially is test-assigned to a bin: i.e. the item is assigned to the bin in such a manner that the final assignment of the item is done in a later step. In other preferred embodiments of the invention more than one item is considered and in this case these items are considered as one item in the sense that for instance the characteristic properties are added together. With the platform according to the present invention being provided, the assigning method comprises: (a) selecting a bin for test-assigning, (b) test-assigning the at least one items to be test-assigned into the bin selected for test assigning, determine the batch size for the bin and mark the test-assigned item(s) for the bin, (c) selecting from the group of bins a bin for test-fitting and i) test-fitting an unmarked item of the group of items into the bin selected for test-fitting and determine the batch size of the bin ii) marking the item for the bin selected for test-fitting if the batch size is within or below the specified requirement(s), iii) repeating steps i) and ii) until either the batch size is above the specified requirements or no further item is to be test-fitted, iv) recording the batch size of the bin selected for test-fitting, selecting another bin for test fitting and repeating step i)-iv) until no further bins are to be selected for test-fitting, (d) recording the total batch size for the bins selected for test-fitting, (e) selecting another bin for test-assigning and repeating steps (b)-(e) until no further bin is to be selected for test-assigning, and (f) assigning the at least one test-assigned item(s) to the bin resulting in a total batch size fulfilling a predetermined criterion, such as the smallest overweight, or to a rejection position if no such bin exists. In the present application, a number of terms are used which are commonly used in the bin packing and batching literature. An explanation of some of the special terms and concepts relevant to the present invention is given in the following items: Bin: - A collection of items (may, of course, comprise only one item) Batch shortage: - The amount, for instance expressed in (kilo)grams, that should be placed in a bin for that bin to fulfil a predetermined batch size. Batch size: - The amount, for instance expressed in kilograms, contained in a bin. Test-fitting: - Fictively placing an item in a bin. Test-assigning: Fictively assigning an item to a bin. The method may be viewed upon as a method combining a number of items into groups in such a way that the combination results in a total batch size of the groups, i.e. the sum of the characteristic property of each group, being the smallest possible. The smallest possible batch size will, of course, depend at least on the order of selecting the bins to be test-fitted and on the order of selecting the items to be test-fitted in the bins selected. In a preferred embodiment of the present invention the items to be test-fitted being selected from the group of items is selected in descending order with respect to the characteristic property/properties of the items, the first selected item is the one having the largest characteristic property/properties and the last item selected last is the item having the smallest characteristic property. By selecting the items in descending order, by for instance selecting the item having the highest weight first, it may be assured that always the item being the largest unmarked item of the group of items that fits into the bin in question is marked for that bin. This may provide a combination of the items into the bin resulting in a total batch size being smaller than if for instance the items are selected randomly. In order for the method to be fast in case the items is to be selected in descending order the items present in the group of items may both be arranged and selected in descending order with respect to the characteristic property/properties of the items, the first selected item to be test-fitted is the item having the highest characteristic property/properties and wherein the last selected item to be test-fitted is the item having the smallest characteristic property/properties. When the items is sorted and selected in descending order, test-fitting of items into a particular bin may be terminated when the batch size of that particular bin meets the requirements as the remaining items is known to be smaller than the items already test- fitted. In yet another preferred embodiment of the present invention the method may further comprise the step of arranging the bins ascending, least batch shortage first, after test- assigning and wherein the bins selected for test-fitting are selected sequentially starting with the bin having the least batch shortage. This step is in a presently most preferred embodiment of the present invention, included together with the arranging/selecting step of the items in descending order. This arranging/ordering provides a very advantageous method in which the items are combined into the bins so that the combination of items giving the smallest total batch size may be detected. In another aspect of the present invention, the items of the group of items being pretended must be provided. The assigning method is typically applied in connection with a stream of items arriving sequentially to a detection station for detection and record of a number of characteristic properties detected is preferably being kept In a preferred embodiment of the present invention the pretended items of the group of items are being provided by a retrospective method. In a particular embodiment thereof the pretended items are being provided so that the pretended items of the group of items have substantially the same characteristic property/properties as the items assigned most recently. In another preferred embodiment of the present invention the pretended items of the group of items are being provided by a simulation method. In a particular embodiment thereof, the characteristic properties/property is/are being simulated according to an empirical distribution of the characteristic property/properties of the items assigned most recently. In yet another preferred embodiment the pretended items of the group of items are being provided by a scenario method, wherein, in a preferred embodiment thereof, the items are being provided so that the histogram of the pretended items is substantially the same as the histogram/empirical of the distribution of the characteristic property/properties of the items assigned most recently. The empirical histogram is recalculated with respect to the desired number of imaginary items that we want to assign weights to. Then we round the number to nearest integer. And then the imaginary items have the weights equal to the intervals. The assigning method according to the present invention is in a presently most preferred embodiment of the present invention applied for assigning items being food stuff such as fish, meat or the like. In another aspect of the present invention the method is applied for grading a stream of items into a group of bins comprising at least one bin according to one or more characteristic property of the item (such as weight, volume, size, colour and/or number) by applying the assigning method according to the present invention. in this aspect the method comprises the steps of: ■ conveying the item(s) from a first to a second location, the second position being either a bin or a rejection position; ■ detecting one or more of the characteristic property of the items as they are being conveyed; ■ assigning, if possible, the detected item(s) to a bin, the assignment is based on the one more detected characteristic property/properties; ■ conveying the item(s) to the bin to which the item(s) is /are assigned if the item(s) is/are assigned to a bin, or ■ conveying the item(s) to a rejection position if the item(s) is/are not assigned to a bin. The items to be graded are in a preferred embodiment of the present invention preferably food stuff items such as fish, meat or the like. According to a third aspect the present invention relates to an apparatus for batching food items into batches, the apparatus is being adapted to perform the method steps of forming combination and assigning those combinations to batches described above. Detailed description of the invention In general the present invention rely on the idea of establishing a measure for the ability of being able to fill a group of bins when only a small number - and in some cases - only one item is detected in a stream of items. Such a measure is according to the present invention established for a group of bins of for instance two bins. The group of bins is test- fitted with items from a group of items comprising generated and known items unless special requirements state different. Consider the case where group of bins comprises two bins, bin A and B. Firstly, a known item is test-assigned to one of the bins, say A, bins A and B are then filled, using a given batching or assigning method, with items comprised in the group of items until an upper limit for the weight of the bin is reached and the total overweight, i.e.: W A =W A,A +W A,B , is recorded. (W AιA refers to the overweight of bin A with known item in bin A and W A B refers to the overweight of bin B with known item in bin A). Secondly, the known item is test-assigned into bin B and the total overweight, i.e.: is recorded. Having determined these two overweighs, W A and W B , the known item is then assigned to the bin which resulted in the smallest total overweight. In the following the invention will be described in greater details. In particular the different ways of generating groups of items are described in connection with the basic method of assigning items to bins according to the present invention. It should be quite clear to a person skilled in the art that modifications to the method and the item generation should be within the scope of the present invention. Preferred embodiments will be described in greater details in connection with the accompanying drawings in which Fig. 1 shows schematically a conveying system, in which the method according to the present invention has been incorporated for assigning items to bins, Fig. 2 shows schematically a preferred embodiment of the method according to the present invention, Fig. 3 shows a functional diagram of a preferred method for batching items, Fig. 4 shows a functional diagram of post processing of the assignment of items to batches, and Fig. 5 shows a functional diagram of another way of assignment items to batches. Several different methods can be used to assign items to bins. These methods can be categorised as follows: 1. Complete Enumeration, i.e. all. possible combinations of assigning items to bins are tried and the one with least overweight is selected. This method requires extremely great computation time and can only be practical for very few items and/or bins. 2. Optimisation methods. 2.1 Branch and Bounds methods. 2.2 Dynamic Programming methods. 2.3 Other optimisation methods for solving combinatorial problems. 3. Evolutionary Search methods. 3.1 Genetic Algorithms. 3.2 Simulated Annealing. 3.3 Tabu Search. 3.4 Other evolutionary search methods. 4. Artificial Intelligence methods. 4.1 Neural Network. 4.2 Fuzzy Logic. 4.3 Other Artificial Intelligence methods. 5. Heuristic methods. 5.1 Probabilistic Calculation methods. 5.2 First Fit Decreasing (FFD) heuristics. 5.3 Other heuristic methods. In the following, a detailed description of the following methods will be outlined: • 2.1 Branch and Bounds, • 3.1 Genetic Algorithms and • 5.2 First Fit Decreasing. 2.1 Branch and Bounds We assume that the items arrive in a simple sequence to the grader after having been weighted. A conveyor moves the items from the weight to the grader and it can store as many items as are needed for the batching. The grader takes the foremost item in the sequence and moves them into the bin that the batching has selected. No discard is permitted all items have to be selected into a package, where no item is permitted to run of the conveyor without being put into a package. Algorithm In principle the method is based on solving a knapsack problem. Added to the knapsack problem is the requisition that follow the arrangement already described that is the items come in a sequence and discards are not permitted. To expand the Knapsack problem an algorithm by Martello and Toth (MT1) was used and adapted to the problem. The adoption consisted mainly of converting the maximums into minimums. Martello ' s and Toth ' s algorithm can briefly be described by refer to the three lowest layers in the table below, 4. DS (Dynamic sequence) 3. MKP(Muliple Knapsack Problem) 2. ULB(Uρper & Lower bounds) 1. SKP(Single Knapsack Problem where each layer calls on the next lower layer. The fourth and the top layer explains when the items arrive in a simple sequence to the grader after having been weighted as described above, wherein said method calls on the adapted algorithm of Martellos and Toth. The description of the layers is not exact but points out the specialities and the main points of interest for each layer. 1. layer (SKP) The function: • To select from a given collection items that fill one packages and give the lowest underweight that is maximises the package Input: • Size of package to be filled • Size of the items that are for disposition • Number of items that are for disposition Method: Steps: Actions: 1) Initial control 2) Call on MTSL to fill a package 3) Convert information (data) 4) Stop in an algorithm Output: The items that fill a package and give lowest underweight. 2. layer (ULB) Upper: The function: Find some of the highest limits of total weight (sum of all packages) of the packages that are being selected into. Input: • Number of packages that are to be filled Size of the packages that are to be filled Number of items for disposition Size of items for disposition Information on items that have already been selected for other packages • Information on what items are in the set of fixed items i, number on the package that is to be fill first Method: Step: Method: 1) Initial arrangement 2) Call on SKP for filling package, 1 3) Reserve the items that had been selected 4) Call on SKP to fill next package 5) Reserve the items that had been selected 6) If an empty package exist move to 4) 7) Stop the algorithm Output: • upperlimits=total weight of all the packages • The items that form the total weight marked for the package they are to fill Lower: Function: • To find the lowest lower limit on total weight (sum of all packages weight) that possibly could be used, for the packages that are to be filled. Number of packages that are to be filled Size of the packages that are to be filled Number of items that are for disposition Size of the items that are for disposition Information on items that have been selected for defined packages • Information on what items are in the set of fixes items i, number of the packages that is being filled Action: Step: Method: 1) Initial arrangement 2) Form one total packages that is the sum of all the packages that are to be filled 3) Call on SKP to fill the total packages 4) Stop in the algorithm Output: Lowest upperlimit=weight of the total package. 3. laver (MKP Function: Select from a collection of items the items that are to fill many packages and give at the same time lowest total weight. Input: • Number of packages that are to be filled • Size of the packages that are to be filled • Number of items that are for disposition • Size of the items that are for disposition Step Method: 1) Initial arrangement 2) Lowest upper tlimt=+oc 3) Call on Lower to calculate lowest tlimit for the set of free items 4) Call Upper to calculate upper limit for the solution set for the union of sets fixed and free items 5) Lower limit=lowest limit 6) If upper limit < lowest upper limit (Lowest upper limit=upper limit Store solution set If lowest upper limit =lower limit go to step 1 If lowest upper limit=lower limit go to step 9) 7) If there exist items in the set of free items that are marked i sack then Select items from set of free items that are marked i sack move selected items from set of free items to set of it fixed items Call on Lower to calculate lower limit for the union of sets of free and fixed items If lowest upper limit = lowest lower limit go to step 9 Go to step 7 8) If there exist a sack i+1 then ( i= i+1.) Go to step 7 9) If there are items in set fixed items marked sack i then Select items from set fixed items marked sack i If items are excluded from sack i then Move items into set of free items or Exclude from sack i Call on Lower to calculate lower limit for the union set of free and fixed items If lower limit<lower upper limit then go to step 5 Go to step 9 10) If there is a sack i then i= i+1 go to step 9 11) Quit the programme Output: • Least possible total weight • The items that give total weight, marked the package that the fill. 4. layer (PS) The function: • To keep bookkeeping on empty space in each package. Empty space in each package is then used as input into the NKP layer • To form a collection from old and new items from an item queue, that is then used as input into the NKP layer • To sort the items selected by the NKP layer into the right package • Supervise that the foremost item in the sequence is aiways put into a package even though not selected by the NKP layer Input: • Item queue • Size of packages that are to be filled • Number of packages that are to be filled Method: Step: Method: 1) Initial arrangement 2) Read in data 3) Call on NKP to calculate examples 4) If the first item in the sequence is selected then ( Take the item out of the sequence and put into the right package) or ( select reject package( a reject package is a package that has the least fill) (Take an item from the sequence and put into reject package) 5) If the package is full then (then return the package, empty the package and put in a new package) 6) If the sequence is not empty the go to step 2 7) Stop in the algorithm Output; • Nothing Side effect: • Empty item sequence • Sequence of full packages • Half filled packages not possible to fill before the item sequence was empty. Variation to 4 layer: To increase the speed the fourth layer can be altered in such a way that it takes all selected items from the front of the sequence all the way to an item that is not selected. This can be done by adding one step 5a): 5a) If the first item in sequence is selected and the last item did not go into a reject package then goes to step 4). Also the reject package can be the package that has the most items. That has not been investigated in the presentation given here. Results Property of DSMKP The properties of DSMKP was investigated for different input. The main property of the excess weight are: • It swings around minimising function A ■ e 'c D + E , where C is the size of package being filled and A, B, D and E are constants. This leads to that excess weight minimise with larger packages (Larger C). TW • Has stationary maximum in n -TW + where n= 1 , 2, 3 • Has stationary minimum value in n -TW where n=1, 2, 3,. • The swing decreases with increase in C. • The swing decreases wit increasing standard deviation σ. Calculation speed The calculation speed has been investigated for 0 backtrack. The algorithm delivered on the average 30 till 80 items per sec. and given premises. It is worth noticing that the speed is highest when the packages are an integer multiple of the items size and it decreases as the size of the packages increases. Here is therefore sable algorithm for batching into packages that is based on integer optimising. Length of a queue Number of items in a queue is variable. The length of a queue is dependent how much space is still to fill the packages and the mean weight of the items. The range size is: No. of item in a queue (items) = empty space in packages (g)/Mean weight of item(g/item) The queue is longest when all the packages are empty and gets shorter a packages are filled. Also the queue becomes long if the items are small and the packages large. No investigation was made on how it altered with average length of queue (sequence) or how it altered with size of package or mean weight of items. Comparison on blind scanning Formula that describes the mean excess weight for packages of size C and normal distribution item collection where mean item size is TW and standard deviation σ is given by OW = k - TW - C £=number of items in a package £=mean number items in a package C=size of a package being filled TVl^mean size of items in a item collection σ=standard deviation of items in a item collection Comparing blind scan and DSMKP and DSMKP has different property to blind scanning. The following table shows comparison of behaviour excess weight DSMKP and blind scanning. Comparing DSMKP to LPV show's all the same properties in both methods. The main difference. • DSMKP gives in most cases lower excess weight • DSMKP has less variables than LPV to control • Calculating speed greater than DSMKP • Simpler than programming the LPV method Algorithm In the following description the idea of the algorithm is described. Their relation is listed below. 4. Dynamic Sequence 3. MTM min ( Martello and Toth. MKP Minimise) 2. Upper lower 1. SKP (Single Knapsack Problem) 0. Martello and Toth. SSP for Large-size problems) MTSL Input: • Number of items for disposition, n • Size of package that is to be filled, c . Size of items that are for disposition , w , • initial value for number of items that are to be examined, v • Calculated sizes that control how much storage the calculations take, MA, MB and Output: • Weight of package, Z<c The items in the package, x j Algorithm: (Z,x 3 ) MTSL, (n, c, w 3 , MA, NB, c) begin Algorithm MTSL end SKP Input: Size of package that is to be filled, c Set of the items that are for disposition. N Size of all known items, Wj Output: Weight of package, E<c items that fill I a package , R, Algorithm Upper input Number of the packages that are to be filled, m Size of the packages that are to be filled, c k Number of items that are for disposition, n Size of items for disposition, wj • Information what items have already been put into packages, x^ Information what items are in the set of fixes items, S k Number of the package that items are to be filled into first, i Output, • Over limit=total weight of all packages U Items that give the total weight marked the package they are in, x kj Lower input • Number of the packages that are to be filled, m • Size of the packages that are to be filled, c k • Number of items that are for disposition , n • Size of items for disposition, wj • Information what items have already been put into packages, x kj • Information what items are in the set of fixes items , S k • Number of the package that items are being put into now, i Output, • Lowest lower limit =weight of the total package , L TMmin input • Number of the packages that are to be filled, m • Size of the packages that are to be filled, c k • Number of items that are for disposition , n • Size of items for disposition, wj Output; • Least possible total weight, z • Items that give the total weight marked the package they are in , Xj DS Input; Name of input.; Input Name of output, Output Number of package to be put into, m Size of package to be put into , initboxsize Output Non Side effect Empty item queue Queue of empty package Half filled queue of packages that were not filled before the item queue was empty Blind scanning Parallel arrangement with KP Knapsack problem is in principle parallel selection of items that is to say, it does not matter in what sequence the items are taken from the collection. The same is valid for multiple knapsack problems. The environment and solution that have been described here is an alteration on these and goes in fact across the parallel selection because it requires the items to be selected in a defined sequence. A short investigation has been made on what would alter for mean excess weight of packages if this requirement is skipped. The result showed that it was mush better solution to skip this requirement and alter the arrangement into parallel selection of items. This is quite clear as it is known that KP and MKP do optimise while no such thing is known about the queue method as LPV and DSMKP. No exact measurement was made on speed of calculation in this arrangement but the total length of calculating time and individual solutions were within reasonable limits. It is sufficient to know 15 items to pack well in less than 2000g package. If the fewer than 15 items are known, the excess weight increases as the package increases. At some point in time no item enters a package, no selection take place. If more than 15 items are known very little is known for packages larger than 2000g. Distribution of excess weight formula for blind scanning DESIGN VARIATION WITH KP Knapsack problem kp is in principle parallel selection of items that is to say it does not matter in what order the items are taken from the collection. The same is valid for multiple knapsack problem mkp. The environment and the solution described here is an alteration it goes athwart on the unbuild parallel selection of items by demanding that the items are selected in a defined sequence. A short investigation was made on what would alter for the excess weight if this requirement is skipped. The result shows that it is much better to skip this requirement and alter the selection to parallel selection of items. It is clear that KP and MPK are optimising methods, as no such thing is known about the sequence methods LPV and DSMKP. No exact measurement was made on calculating speed for this arrangement but total calculating time and specific solution seemed to be within sensible time limits. It is sufficient to know 15 items to pack well into a package less than 2000 g. If fewer items than 15 are known, then the excess weight increases in direct relation to the increase in size. At some time all the items go into a package, no selection takes place. If more items than 15 are known very little time is gained for packages less than 2000g. 3.1 Genetic Algorithms All genetic algorithms have a defined number of individuals (λ) each describing one solution. Each individual is symbolises with a vector and each component in the vector is called gen. The individual is developed through a defined number of generation and in each generation there are cross-overs, mutations and selection of individuals of that generation. Cross-over is the main search index for genetic algorithm and is based on cross-over of parts of gens from two good individuals and it is tried to create a new one that is better. In solving this project it was considered suitable to use uniform cross-over with 40% probability of cross-over. Then there is 40% cross-over of units between the two individuals. Mutation is sometimes omitted when designing genetic algorithms but then the aim is to increase multiplicity of the individuals. Here mutation was used with the probability of 1/m where m is the number of known items and on the average one mutation is performed on each individual. Selection is the most important part of genetic algorithm but it oversees selecting the individuals that are allowed to proceed and form parents for the next generation. It is important that the selection secures that convergence happens sufficiently fast as fast convergence could lead to stationary extreme values. When selecting parents for the next generation the skill of all individuals are found and a defined selection method utilised. Tournament selection is based on comparing the skill values of two individuals and select the better one. Arrangement Each individual needs to describe the sorting of the items that are known into the bins of the grader. It was therefore decided that each element in the individual was an integer that indicated a bin in the grader. Location of the element describes what item of those that are known, should go to the bin. As it is necessary to sort the items in the order they arrive to the grader certain restrictions are introduced on the optimising. The optimising is dynamic, as the premise of the optimising is mobile. As soon as the foremost item is sorted into one of the bins the situation is altered, because at the same time a subsequent item behind the known sequence enters into the known sequence of items for sorting. Taking into consideration that sorting the foremost item is to a large extend depend on what items arrive next after it, it is natural to keep their shorting unaltered. To encourage less variation in the foremost items and at the same time increase the speed of the optimising, the last generation of sorted items was used as the first generation for shorting item i+1. It proved though necessary to build another sequence for the backmost items to increase the variation in their shorting. When batching is performed this way it is possible to increase its speed by self-adaptation in a number of generations. The capacity of genetic algorithm determines to a large extend by the number of generations that is the more generation the longer time it takes to optimise, but at the same time better results can be expected. Self-adaptation in number of generations is used in such a way that at the beginning the number of generation is large but decreases in accordance to what generation gives the best solutions. Evaluation of individuals qualifications In general it is valid for optimising programmes that the function to be minimised or maximised has to describe the aim of the optimising. The main aim of batching of items that follow a defined weight distribution is to minimise the mean excess weight of a package. Therefore it was decided to assess the qualification of an individuals by the following objective function: £ wp —m j /, = Σ 1) ;=1 Tn Where wp t is the weight of package no i m,is predefined minimum weight of package Tn is integer number of packages formed from known package With correct arrangement this equation will distribute the items evenly into the bins as the algorithm has no tendency to select one bin above another. At the same time equation 1 will contribute to that the bin will be filled quickly as the nominator increases at the same time as a new package is formed. As can be seen from equation 1 the objective function is independent of the weight distribution of the items and can therefore function for different distributions. On the other hand it can be seen that the result of the batching will all the same be dependent on the distribution. This can easily be seen by taking on one hand uniform distribution and on the other hand normal distribution with low standard deviation where the mean normal distribution is divided in the packages size. Few items known: A limiting function that is based only on mean excess weight of the packages is sensitive to the number of items. If for example 5 items are needed on the average to form a package and the number of bins are 6 it is clear that knowledge on the weight of next 10 items is only partly useful. In reality the knowledge is only useful for selecting the last item put in a package. When a bin is empty the algorithm gives no encouragement to select together items that contribute to filling a bin to low excess weight. A trial to solve this problem is to calculate the expected weight of the items that is to be sorted. The 10 its that are known are sorted into the bins and "virtual items" used to fill the bins. The weight of the virtual items is the expected weight at each particular time. Weighted average of the real weight of the items and the mean excess weight that is formed in the bin that is filled up with virtual items then form the objective function. The problem proved to be to determine how high excess weight because of virtual items should be, that is selection of the constant : where wu h is the sum of the weight of the items in bin h, S h is the number of virtual items needed to fill bin h, Tu is the number of unfilled bins, Vj is a predetermined weight and P(V,) the probability that weight Vj appears. Many items known: At first glance it may be difficult to see that knowledge of the weight of many items can diminish the success of the optimising. If however the limiting function 1 is used it can be seen the mean excess weight takes into account all packages irrespective if they are formed by the foremost items or items at the back of those that are known. In that way an individual can increase his throughput by sorting the items at the back better, the more items are known, less value has the sorting of the items at the front. To solve this problema weighing constant could be introduced who's value depended on how many items are known and if the package was formed from the foremost items or not. Equation 3 shows this suggestion: wp -mi 3) Tn βι is the expectancy coefficient. It is all the same important that the expectancy coefficients (β) is dependant on when the package is formed but not if it is formed for example from the 5 first items. If they depended on the 5 first items the algorithm would try to sort them in such a way that they did not fill any bin and thus result in keeping the bins nearly filled. Algorithm The following algorithm shows the main steps in the optimising the program. It is based on the objective function 1 , but to do alterations it is only necessary to rewrite some steps in accordance to equations 2 and 3: 1. Presentation 1.1 Number of bins, H 1.2 Size of packages 1.3 Number of known items, m 1.4 Number of generations .G. and individuals ,λ, G(1) =50 and λ=1,5m 1.5 Initial sorting of the first m items 2. In-reading of first items i=1 3. Genetic algorithm runs the first m items, g=1 Input: Weight of next m known items, minimum size of packages, λ. G (i) . position in bins, initial generation. Output: Number of a bin that should receive l-th item, final generation, the number of the generation where the best solution was obtained Gb(i) 3.1 Qualification ratings of all individuals found j=1 Input: Situation in bins, weight of next m known items, minimum size of package, individuals of a generation g. Output: Mean excess weight of package for each individual. 3.1.1 Item j sorted into a bin x(j) vector that include the bin number (sorting vector). 3.1.2 Investigated if the sum of all items in a bin x(j) has reached a minimum weight If yes => bin excess weight recorded and the bin emptied. 3.1.3 Second step 3.1.1. with j=j+1 where j=m 3.1.4 Step 3.1.1 -3.1.3 repeated for λ individuals 3.1.5 Average weight packages found for all individuals. The most qualified individual has lowest mean excess weight. 3.2 The individual giving lowest excess weight found and investigated if he is better than individual from former generation. If yes =>Number of the generation recorded in Gb and the best individual upgraded. 3.3 The individual two and two compared and the more qualified individual selected for the next generation. (tournament selection ) 3.4 Cross-over of elements between two ranking vectors (uniform cross-over) with 40% probability. 3.5 Mutation with the probability 1/m 3.6 Secure that the best individual is spared for the next generation (e. elitist selection) 3.7 Again at step 3.1 with g=g+1 until g=G(i) 4. i-th item shorted into a bin according to output of the genetic algorithm 5. Number of generation for next iteration updated according to: Is G(b) =G or Gb(i)<30 lf yes =>G(i+1)=Gb(i)+a lf no = G(i+1)=Gb(i) As a is an integer and a constant determined to secure that the number of generation will not became so small that a no good solution is found. a=5 proved good and was used for solving the project. After sorting of the first items it proved sufficient to have 30 generations for getting a good result. 6. Investigated if weigh of all items in the bin that were sorted have reached minimum weight. If yes=>the weight of the package recorded and the bin emptied 7. Weight m+i items recorded, i=i+1 8. Back to step 3 until all items have been sorted 5. Results of simulation By simulating batching with genetic algorithm the relation between mean-excess weight and the main factors of influence were investigated where the aim was to minimise excess weight. At the same time two types of comparison were made. • Mean excess weight was investigated as a function of package size for the objective function 1 and the results compare to the results for the LPY method and the DSMKP method • Comparison of the objective functions Premises It was decided to relay on premises that the results of the project about DSMKP and LPV (3) to simplify compilation. The main premises are: • Weight distribution of the items follow normal distribution N(200,21) • It is sorted into 4 bins if not otherwise specified • The number of known items is 20 or 40 • In each run 1000 items are sorted but to increase the reliability of the results there are in each case taken the averages of 3 runs. Commotion between mean excess weight and the main factors of influence To explain how size of packages, number of bins and number of known items influence the results of batching using genetic algorithm the mean excess weight are examined for each case. Size of packages: The result shows that the minimum mean excess weight is reached when the packages size is an integer of mean weight distribution and at the same time that the mean excess weight decreases with larger packages. Mean excess weight was on one hand examined as 20 items were known (GA 20) and on the other hand when 40 items were known (GA 20). GA 20 gives a lower mean excess weight than GA 40 for packages below 1000 g when the size of package is an integer multiple of mean but GA 40 gives lower mean excess weight fort larger packages. GA 40 also gives better results when the package size is unsuitable. This confirms two things; • When discards are not allowed and the items are sorted as they arrive on the conveyor it is of little gain in knowing the sum of more items than can be put into all bins at one time. Knowledge of more items decreases the results of batching as the important of the foremost items decreases. • When a few items are known and the packages are large the mean excess weight is slightly increased for larger packages that are integer multiply of the mean weight distribution Calculations for 600g packages were done to get an idea on how the mean excess weight is formed or if all packages have similar excess weight or the excess weight is formed by a few packages with large excess weight. The result showed that they are most part below mean weight. Only about 20% of the packages contribute 75% of the excess weight. There is no way algorithm can fully prevent packages with high excess weight unless discard is permitted. To minimise packages with high excess weight a trial was made in sorting items taking their weight distribution into account. It is based on that if a bin gets into an unfavourable situation, it was penalised as for high excess weight, and the probability of the individual to have an offspring decrease. A bin was considered to be in an unfavourable situation if the sum of the item weights therein is near the minimum weight of the package. This trial was not successful and gave higher excess weight in all cases. This is based on the fact that it is difficult to evaluate a packages excess weight against a bins unfavourable situation. The penalty because of unfavourable situation decreased the importance of sorting items in such a way that the mean excess weight was at minimum. This shows again that it is difficult to improve the results with genetic algorithm without permitting discards. On the other hand most certainly it should be possible to improve the result by permitting limited discard and introducing restriction on the optimising that secured a bin does not come into an unfavourable situation. Number of bins: The result for 600g package shows that the mean excess weight decreased with increasing number of bins for GA 20 and GA 40. Identical results are obtained for other package sizes. If the packages are suitable for the weight distribution of the items the curves lowers for larger packages and become flatter, that is, less difference in excess weight for different number of bins. The result shows that perfect number of bins is primarily dependent on how many items are known. It is notable that mean excess weight lowers at the begin but then increases slightly when a defined number of bins are reached. The reason for this is the same as that for increase in mean excess weight when the packages became very large as effect of increased number bins is the same as the effect of larger packages. It can also be seen that the gain in increasing the number of bins decreases unfailingly until the ideal number of bins is obtained. Compilation LPA and DSMKP Comparison of mean excess weight on one hand given by GA 20, GA 40 and the other hand by LPV and DSMSK shows that for most packages sizes the GA 20 and GA 40 give lower mean excess weight. The GA 20 seems to be the best of these four methods when the packages are on the lower side and fits the weight distribution of the items well. On the other hand, when the packages have become large GA 40 proves best and it can be expected that with increased package size the weight of more items must be known. It can be expected that the uncertainty in published results for LPV and DSMKP are about 1g as they are based on reading from a report done by Engineering Department of the University of Iceland 1997. The premises for batching for all the four methods are in principle the same with the exception that the results of the LPV and DSMKP methods are based on sorting 10.000 items. The reason for that GA 20 and GA40 give better results than LPV is that LPV decides on basis of the items weight and weight distribution. GA knows on one hand the weight of next 20 items and GA 40 the next 4o items and can make a decision based on the items that still are to come. DSMKP utilises also knowledge of the weight of items after the one that is being sorted and the difference of the DSMKP and GA method is small. The explanation may be that the DSMKP edition that the results are based on was not fully arranged and finished. Compilation of limiting functions These results of different packages sizes based on 20 known items show that it is possible to improve these for defined cases by adapting the objective function to the circumstances. When a few items are known it improves the results of the sorting to take into account the expected value of the items and to encourage suitable sorting into half filled bins. Simulation of batching with objective function 3 when expectancy coefficient is used to increase the relevance of the sorting of the foremost items gives no better results than the objective function 1. The simulation was performed with β^4 and p 2 =2 for GA 40. Possibly better results could be obtained with higher coefficient of expectation. Capacity of genetic algorithms and distribution into bins It is important that the methods for batching are fast and can make decision before the item to be sorted arrives at the first bin. At the same time the method has to minimise the time an item is kept in a bins. Capacity: The capacity of the method is mainly dependent upon the number of known items. The less items known, the faster is the method. This is explained by that in each round the results have to be optimised for the items that are known and the time needed to calculate increases with increased number of items. Also the number of individuals is increased with increased number of known items as it is necessary to increase the number of individuals as it necessary that is at least equal to the number of units in each individual to give a good solution. When simulating it became apparent that self-adaptation of number of generation it is important to increase the capacity of the algorithm. The capacity of the algorithm is on the average multiplied by 5 by introducing self adaptation into the compilation by having the number of generation always 50. On the other hand it is to be expected that in exceptional cases that good solutions are lost if capacity is increased. When sorting items into 4 bins and 600 g packages the capacity was around two per second when 20 items were known but half an item when 40 items were known. The capacity increased slightly with larger packages. It was investigated what effect sorting more than one item at the same time had on capacity. If 5 items are sorted at the same time a measurable difference was observed on mean excess weight to sorting one item at a time. This shows that the capacity of the method can be increased considerably without increasing mean excess weight. Distribution into bins: Result showed that the frequency of package weight for batching 600g package, 4 bins and 20 known items, is nearly equal. The conclusion can be drawn that the bins do not stand half filled a long time. This needs to be investigated better because if a bin comes in an unsuitable situation excess weight of the packages being formed is high and the encouragement to fill the bin become less. A bin stand therefore never nearly filled if the bins are few because the possibility for sorting decreases as the bins in unsuitable situations increases. This happens because it is best to finish a half filled bin so it can be emptied and sorting started again. Programming and simulation can preferably be performed Matlab 5.3 on Deltacomputer with 450 MHz Pentium III microprocessor and 128 Mb RAM. A function that simulates sorting of items into bins function [medal, package] = batchingl (m,lagm,H) %Functions: %H=Number of bins %m=number of known items %M=mass of individual items %lamda=number of individuals %G=number of generations %Vlgt(hόlf)=total weight of items in a bin % Arrangement medal = 200; stadal = 21 , M = randn (m,1) * stadal < medal; P=0; lamda=1.5*m; G(1) = 50; wreight=zeros (1 ,H) b=rand (lamda.m) for i=1: 1000 bin, b,Gf(i)] = gen(M(i:m+i-1),lagm,lamda,G(i),vigt,b); %selfadaption of number of generation if (G(i)==Gf(i) ! Gf(i) <30) G((i+1)=Gf(i) +5; else G((i+1)=Gf(i) ; end %item put into a bin weight (holf) = weight (holf) + M(i); h(i)=bin; if (weight(holf) >= lagm) P - P+1; package(p) 0 weight (bin); weight (holf) = 0; full bin(p)=bin; end M(m+i) = randn(1) * stadal + medal; end %average excess weight medal=sum(package-lagm)/length(package); Function that simulates sorting of items into bins and finds expectancy value of the weight function [medal,package]=samval12 (m.lagm.H) %Functions: %H =Number of bins %frequency=frequency distribution of items %lamda = number of individuals %m = number of known items %M = mass of individual items %K= number of items between arrangements %T = the number of items that the frequency diagram is based/K %N= number of sorted items %D = Sorting of item based on weight %G = Number of generations %Weight(bin) = total weight of items in a bin %llnitial arrangement medal = 200; stadal = 21 ; M = randn(m,1)*stadal + medal; K = m; T = 10 distribute = ceil ((randn(m,1)*stadal + medal)/10); distribute = ceil (M/10); frequency=[repmat((hist(dreif,1 :1 :max(dreif)))VK; (hist(dreifM,1:1 :max(dreif)))'/K]; histogr =[(10:10:max dreif)*10)' sum(tidni,2)/length(tidni(1 ,:))]; E = histogr(:,1)' * histogr(:,2); P = 0; Lamda = m + 10;; G(1) = 50; Vigt = Zeros(1,H); D = zeros (max(dreif) + 20,1); b = rand(lambda,m); for i = 1 :1000 [holf,bGf(i)] = gen(M(i:(m-1) +i),lagm,lambda,G(i),vigt,b,E); %selfadaption of number of generations if (G(i)==Gf(i) I Gf(i) <30) G(i+1) = Gf(i) +5; else G(i+1) = Gf(i) ; end %item put into a bin weight(bin) = weight(bin) + M(i); if (weight/bin) >= lagm) p = p+1 ; package (p) = weight(bin); weight(bin)=0; end M(m+i) = randn(1) * stadal+medal; %Frequencydistri bution n = ceil(M(m+i)/10); %weight sorted (10 gr between groups) D(n,1) = D(n,1) +1 ; sn = size (D); sh = size (tidni); if sum (D) ==K if sn(1) > sh(1) frequency(end+1 :sn(1),:) = zeros (sn(1)-sh(1),sh(2)); frequency = [frequencyi(:,2:T) D/K]; D = zeros(sn(1),1); else D(end+1:sh(1)) = zeros(sh(1)-sn(1),1); tidni = [tidni(:,2:η D/K]; D = zeros(sn(1),1); end histogr =[(10:10:sn(1) * 10)' sum(tidni,2)/length(tidni(1 ,:))]; %expectancy value E = histogr = (:,1)' * histogr(:,2); end end %average excess weight medal = sum(pakkning-lagm)/length(packning); Genetic algorithm For objective function 2 the expectancy value E is added to input in genetic algorithm and the call in the function weight becomes: f =function weight(x,M,iagm,vigt,E); function [bin,b,Gf] = gen(M.lagm,lambda;G,vigt,b) %lnitial arrangement bf = inf; m =length (M); H = length(vigt(1 ,:); [lb db] = size (b); b(:,end+1:m) = rand(lambda,m-db); for g = 1:G %decoding x = ceil (H * b); f = function weight (x,M,lagm,weight); [Stats(g,1),l] = min (f); Stats (g,2) = mean(f); %store the best individual if Stats (g,1)<bf xb = x(l,:); bb=b(l,:); bf = Stats (g,1); Gf = g; end %selection I = randperm (lambda); J= randperm (lambda); b = b([l(find(f(l)<f(J))) J(fιnd(f(J)<=f(l)))],:); % cross-over for i=1:2:lambda l = find(rand(1,m)<0.4); temp = b(i,:); b(i,l) = b(i+1 ,l); b(i+1,l) = temp(l); end %mutation I = find(rand(lambda,m)<1/m); B(l) = rand(size(l)); %secures that the best individual is preserved b(1,:) = bb; end holf=xb(1); index=round(0.75 * length(b(1,:))); b=b(:,2:index); Objective function 1 -linear function of excess weight function f =function weightl (x,M,lagm,vigt) %lagm=minimum weight in a package %M=weight m of items % initial value weight = repmat(weight,length(x(:,1)),1); v = zeros (length(x(:,1)),max(max(x))); pakk = zeros (length(x(:,1)),1); m = length (M); for i = 1:m forj = 1:length(x(:,1)) vigt G.x(O.i)) = vigt Q,xQ,\)) + M(i); if vigt (j,x(j,i)) >= lagm v(j, χ (j. ) = o, χ θ.')) + v'gt (j X i. ) - 'agm; vigt O.xCi. ) = 0; ρack(j) = pack(j) + 1; end end end 0 = find(pack==0); if ! isempty(O); pack(0) =1; end f = sum(v,2)./pack; Objective function 2- Expectancy value of weight used for sorting coefficients function f = function weight2(x,M,lagm,weight,E) %lagm=minimum weight in a package %M=weight m of items %E=expectancy value of weight %initial value weight = repmat(vigt,length(x(:,1)),1); v = zeros (length(x(:,1)),max(max(x))); ref = v; pack = zeros(length(x(:,1)),1); pack =pack; m = length (M); for i = 1:m forj = 1:length(x(:,1)) vigt (j-x(j.i)) =weight(j,x(j,i)) + M(i); if vigt 0,x(j. ) = weight(j,x(j,i)) + M(i); if vigt G.xG. ) >= lagm vG.xG.i)) = vQ,x(j,i)) + (weight(j.xO.")Hagm); vigt G.x(j,i)) = 0; pakk G) = pakk G) +1 ; end end end a = find(weight); if is empty(a) ratiof(a) = ceil((lagm-weight(a))/E); weight (a) = weight(a) + E * hlutf(a)'; end [1 ,d] = ind2sub(size(v),a; for r = 1:length(x(:,1)) packw(r) = packw(r) + length (find(1==r)); %number of package end %excess weight because of virtual items w(a) = weight (a) - lagm; %Finnd individuals that have not formed a package 0 = find(pack==0); if isempty(O) pack (0) = 1 ; end Ov = fιnd(pakkv==0); if is empty(Ov) pack(Ov) = 1 ; end f = 0.1*sum(vv,2)./packv + sum(v,2)Jpack Objective function 3 - Sorting with expectancy coefficients function f = function weight 3(x,Mlagm,weight) %lagm=minimum weight in a package %M=weight m items %E=expectancy value of weight %initial value vigt = repmat(weight,iength(x:,1),1); v(:,:,1) = zeros(length(x(:,1)),max(max(x))); pakk = zeros(length(x(:,1)),1); m = length(M); t = 1; for i = 1 :m forj = 1 :iength(x(:,1)) vigt G.xG.")) = vigtG, χ G, ) + (i); if vigt G,xG.i)) >= lagm if t==1 vG,xG- ) = .x .i)) + m/10 * vigtG,xG,i)) - lagm; t = t+1 ; else vG.xG.i)) = vG,xG,0) + vigt G.xG> ) - lagm; end weight G.xG. ) = 0; packG) = pack G) + ; end end end 0=fιnd(pakk==0); if is empty (0) pakk (0) = 1 ; end f = sum(v,2)./pack; 5.2 First Fit Decreasing As stated above, the method according to the present invention makes use of group of items and that group has to be generated. The basic idea of the methods presented herein for few (N1) or only one known item is to "pretend" that we know the next incoming N2 items. This item generation can be done in at least three ways: A. Retrospective method: We assume that the next N2 items are the same as the N2 last items. This method is preferably applied if the raw material characteristics are changing very frequently. B. Simulation method: We simulate weights of N2 items according to the empirical weight distribution of the previous items. C. Scenario method: We construct a collection of N2 representative items such that the histogram for this collection comes as close as possible to the empirical weight distribution. The group of items will then comprise N1 known items and N2 pretended items and when test-fitting the first known - or the only known item - the remaining number of items to be test-fitted into the bins is then N=N1-1+N2 Regardless of which of these methods is used we fit the first or the only known item into each of the M open bins and calculate the target shortages that would be after each fit (it is here imaginary that the group of items is ordered so that the first item is a known item). The next thing to be done is to develop an estimate for the minimal overweight for the remaining items in the group of items whereof some may be known and some are pretended for each fit, in order to finally choose a bin for the known item, that is to choose the best fit. Now comes the question of which method should be used to bin the known and the pretended items to the bins, given the M target shortages for each fit. We have at least one possibility for this batching method: 1. Heuristic method: In a preferred embodiment of the present invention a very fast and in some sense simple method is chosen, which actually gives upper bounds on the minimal overweight for the N items, N = N1 detected + N2 pretended items. This will be described further below. Besides choosing between the methods for item generation in connection with batching the number N (or N2 as N = N1 + N2) must also be determined. It is found that a too low value of N would restrict the batching unnaturally while too high value would make the batching too "easy" as the batching method could skip a great number of the pretended items. So a balanced value has to be found, depending on M, the number of open bins, and the ratio of the bin target value and the average item weight. Finally, one more parameter has to be chosen. This is the acceptable overweight interval, called here the zone Z. This means that whenever an item fills a bin within the zone it is accepted for that bin. The choice of Z depends on one hand on the demand or expectations of the user to the worst case packing results and on the other hand on the impact on the average overweight. Too small Z restricts the packing while too high Z would in some cases be unnecessarily pessimistic An example of a method specification could be the following short notation: B-1 -20-10 meaning that we simulate the next (pretended) 20 items (N1 of these are actually detected so we simulate N2) and use heuristics for batching, accepting up to 10 grams overweight. In the following we will first describe the heuristic batching method C-1-N-Z, which uses N pretended items and the zone is Z. In order to describe the method for assigning items to a bin this method is described by use of the heuristic batching method. Furthermore, the method is described simplified in the sense that a the characteristic property of an item is considered to be the weight of an item, but as stated in the introduction to the invention the characteristic property of an item considered could just as well be the size, the shape, the colour etc. of the item and also combinations thereof. Heuristic batching method Given a list of N items, whereof N2 are pretended items, the method for assigning an item to a bin can in general be described by the following steps: 1. Sort the N items descending, largest item first. 2. Fit the known item into a bin, say bin A, and calculate the shortage (remaining weight to target). Sort the bins ascending, least shortage first. 3. Heuristic method: Starting with first (least shortage) bin: 4. Try the first (largest) unmarked item: 4.1 If item fits (shortage still positive or overweight within z) mark the item for this bin and recalculate the shortage. Go to 4 (next item, same bin). 4.2 If item is too big (shortage becomes too negative, i.e. overweight greater than the given zone Z), go to 4 and try the next item and so on until an item fits with minimal overweight. Go to 3 (next bin). 4.3 If no item fits the bin mark the last (smallest) for the bin and use the backtracking method described below to try to decrease the overweight of this bin. Go to 3 (next bin). 5. When all bins are finished, record the total overweight for this case (known item in bin say A) and delete all marks. Go to 2, i.e. fit the known item into next bin, say bin B. 6. When fitting the known item into all bins A, B, C ... is finished, compare the overweight for all cases and choose the minimal. This will be the bin for the known item. Go to next known item. Backtracking: This is used when two or more of the pretended items have been allocated to a bin and the last item allocated is the smallest in the sequence of unmarked items and overweight becomes greater than the zone Z. In this case, before accepting this overweight, we mark the last item to the bin and backtrack one item to try to change the next last item, i.e. to find a smaller next last item. These steps are depicted in the flowchart shown in Fig. 2, in which the sorting items descending, largest item first, step is left out for simplifying the graphical depiction of the method only. Item generation methods In the retrospective item generation method record of the last N2 items weights is kept and it is assume that the next pretended N2 items are the same as the N2 last items. This generation of item may be done currently for instance each time an item is assigned to a bin or a rejection position or it may be done after a predetermined number of items have been assigned to a bin or a rejection position. In the last case record of the characteristic property/properties of the assigned items is kept. The simulation method is based on the empirical weight distribution of the previous items (say 500 items). N2 items are chosen randomly from a collection of previous detected and recorded item properties such as weights. The probability of choosing a specific item weight is according to the frequency of this weight in the collection of all previous detected weights. In the scenario method a collection of N2 representative items is constructed such that the histogram for this collection scenario comes as close as possible to the empirical weight distribution of previous detected items. This can for example be done by multiplying N2 with the probability percentage P(k) for each of the histogram classes k = 1 to K, rounding off to the nearest integer and assuming that these int(N * P(k)) pretended items have the same weight as the mid-value of the class. This collection of items should be recalculated periodically or at least when changes are detected in the empirical histogram. As mentioned in the introduction to the invention the invention is directed to - but not limited to - food processing lines where items in the end of processing are collected into portions of a specified size. In a preferred embodiment of the present invention the method is applied in connection with a conveyer system comprising a conveyer belt for conveying the item from a first position to a second position, see Fig. 1. The first position is a cutting station where the raw materials for instance hole fish or meat bodies are cut into pieces, items, for instance by hand or by machine. After cutting the items are conveyed on the conveyer belt past a detection station comprising an electronic scale and a computer for assigning items to bins situated at the second position. During passage of the electronic scale the weight of the item is recorded and by use of the computer the item is either assigned to a specific bin or rejected. The assignment is performed by the method according to the present invention, which is implemented in the following way. Initially - i.e. the first time the assigning method is applied - the method generates a group of pretended elements from scratch. Such a generation may preferably be based on the retrospective method. The first items detected, say 10, are assigned arbitrary to a bin and the detected characteristic of the items (the weights) are recorded by the computer. Now a group of pretended items may be generated based on the first detected items and the method may now be fully applicable. During assigning of items the number of items on which the retrospective item generation method is based may be expanded. Furthermore the item generation method may be shifted to for instance the simulation method or the scenario method if wanted. Eventually, the method when loaded into the computer may comprise a group of pretended items detected elsewhere or provided in another way, and this initial group of pretended items may then by exchanged as items are detected. In some cases bins are to be filled with a large number of items and in this situation the assigning by the method according to the present invention may be by-passed in the beginning of the filling of bins. That means, when an empty bin is to be filled with items, items, which are detected but not processed, is assigned to the bin until the weight of the bin has reached a predetermined limit. The items are then assigned based on the method according to the present invention. Eventually, items may be passed both non-detected and non-processed to bins until the weights of the bins have reached a predetermined limit. In this case the bins must be weighed in order to register the point where they have reached the predetermined limit and for providing weight input to the method according to the invention. Another method for dealing with bins with a large number of items is to fictively divide each bin into a number K of sub-bins and use the above-described method to fill the sub- bins sequentially. When the number K is determined it is preferable to have the sizes of all the sub-bins, or if this is not possible at least the last (highest in the bin) sub-bins, close to the mean value of the weight distribution of items, given that this is a one-peak distribution. This will increase the probability of the bins being filled gradually up in a way so that there will be a great supply of last items that will fit the last sub-bin shortage with low overweight for the bin.

Claims: CLAIMS 1. A method for batching items by a measure, said method comprising the steps of: - by means of a grader, conveying a stream of items from an in-feed area to a grading area wherein at least one item batch is being formed and recording the measure of the items being conveyed, - forming imaginary combinations of items, said combinations comprising items selected from a pool A of items which measure have been recorded and items selected from a pool B of imaginary items, the forming of imaginary combinations comprising the steps of: - recording the measure of the batch and for each batch calculating a difference between a desired measure and the recorded measure, - generating a measure for the items of the pool B, - combining the pool of items A and the pool of items B into an imaginary pool of items, and - assigning combinations of the items selected from the imaginary pool of items to each batch, so that the measure of each batch fulfils a criteria for the batch, - evaluating the imaginary combinations for each batch with respect to a desired measure of the batch and optionally re-forming the imaginary combinations until the evaluation gives a satisfactory result, and - conveying the items to the batch they are assigned to. 2. A method for batching according to claim 1 , wherein the criteria for the batch relates to the measure of the batch. 3. A method for batching according to claim 2, wherein the criteria for the batch relates to an interval of the measure. 4. A method for batching according to claim 1 , wherein the criteria for the batch relates to the number of items in the batch. 5. A method for batching according to claim 1 , wherein the criteria for the batch relates to a combination of the number of items in the batch and the measure of the batch. 6. A method according to any of the preceding claims wherein the measure is a weight measure of the items or of the batch of items. 7. A method according to any of claims 1-4, wherein the measure is a size measure of the items or of the batch of items. 8. A method for batching according to any of the preceding claims, wherein the generation of a measure of the imaginary items comprises: - selecting a number N of imaginary items to include in the pool B, and - generating a measure of the selected number of imaginary items by dividing a known distribution of earlier recorded items into a number N of 100/N- percentile distributions and assigning a measure equal to the average of the lowest percentile to the first imaginary item, a measure equal to the average of the second lowest percentile to the next imaginary item etc. until all imaginary items have been assigned an imaginary measure. 9. A method for batching according to claim 8, wherein the selection of a number N comprises: - calculating a sum of the differences between the desired measures and the recorded measures of all of the batches, - subtracting from the sum the total of the measures of the items in the real pool A, and - dividing the resulting quantity with the average size of a sample of items and adding a small overhead. 10. A method for batching according to any of claims 1-7, wherein the generation of a measure of the imaginary items comprises: - selecting a number N of imaginary items to include in the pool B, - recording the measure of a number M≥N of items, - generating the measure of the N imaginary items by assigning the measure of N items out of the M items to the imaginary items in the pool B. 11. A method for batching according to any of claims 1-7, wherein the generation of a measure of an imaginary item comprises stochastically simulating the measure by the use of an empirical distribution of the previously recorded items and assigning the simulated measure to the imaginary item of the pool B. 12. A method for batching according to any of the preceding claims, wherein the assigning of combinations of the items of the imaginary item pool comprises the steps of: - arranging the batches by the measure, - for one batch, selecting out of the total number of items, the combination of one or more items so that the measure of the batch fulfils the criteria, - assigning that combination to the batch, and - continue selecting combinations until all batches have been filled or until there are no more unassigned items. 13. A method for batching according to claim 12, wherein the batches are arranged from the most filled batch to the least filled batch and wherein the selection of combinations starts with the most filled batch towards the least filled batch. 14. A method for batching according to claim 12, wherein the batches are arranged from the least filled batch to the most filled batch and wherein the selection of combinations starts with the least filled batch towards the most filled batch. 15. A method for batching according to any of the preceding claims, wherein the measure of the items is being recorded continuously as they are conveyed from the in-feet area to the grading area and wherein the assigning of combinations of the items of the imaginary item pool comprises the steps of: - moving the first assigned item to the batch it was assigned to and redoing the assigning of combinations each time the measure of a new piece has been recorded. 16. A method for batching according to any of the preceding claims, wherein the batch or the batches may be emptied after each assigning of an item to a batch, and wherein the difference between the desired measure and the recorded measure is re-calculated after each assigning. 17. A method for batching according to claim 15 or 16, wherein the items are conveyed in a fixed sequence. 18. A method for batching according to any of claims 1-11 , wherein the assigning of combinations of the items of the imaginary item pool comprises the steps of: - randomly choosing a combination for each batch so that the measure of each batch fulfils a criteria, - evaluating the combination for each batch, on the basis of overweight, and/or shortages and using the methods of Genetics Algorithm to make a new combination on the basis of the existing combinations until a pre-specified criteria is fulfilled. 19. A method for batching according to any of the preceding claims, wherein the assigning of combinations is being post processed prior to the conveying of the items into the batches. 20. A method for assigning at least one item having at least one characteristic property to a batch comprised in a group of batches comprising at least one batch, requirement(s) having been made as to an allowable batch size of each batch in terms of for instance a filling zone, a group of items comprising imaginary and optionally also weighed items having been provided and characteristic property/properties of at least one item to be test- assigned having been provided, which method comprises: (a) selecting a batch for test-assigning, (b) test-assigning the at least one items to be test-assigned into the batch selected for test assigning, determine the batch size for the batch and mark the test-assigned item(s) for the batch, (c) selecting from the group of batches a batch for test-fitting and i) test-fitting an unmarked item of the group of items into the batch selected for test-fitting and determine the batch size of the batch ii) marking the item for the batch selected for test-fitting if the batch size is within or below the specified requirement(s), iii) repeating steps i) and ii) until either the batch size is above the specified requirements or no further item is to be test-fitted, 5 iv) recording the batch size of the batch selected for test-fitting, selecting another batch for test fitting and repeating step i)-iv) until no further batches are to be selected for test-fitting, (d) recording the total batch size for the batches selected for test-fitting, (e) selecting another batch for test-assigning and repeating steps (b)-(e) until no 10 further batch is to be selected for test-assigning, and (f) assigning the at least one test-assigned item(s) to the batch resulting in a total batch size fulfilling a predetermined criterion, such as the smallest overweight, or to a rejection position if no such batch exists. 15 21. A method for assigning at least one items to a batch according to claim 20, wherein the items to be test-fitted selected from the group of items is selected in descending order with respect to the characteristic property/properties of the items, the first selected item is the one having the largest characteristic property/properties and the last item selected last is the item having the smallest characteristic property/properties. 20 22. A method for assigning at least one item to a batch according to claim 20 or 21 , wherein the items present in the group of items is being arranged and is being selected in descending order with respect to the characteristic property/properties of the items, the first selected item to be test-fitted is the item having the highest characteristic 25 property/properties and wherein the last selected item to be test-fitted is the item having the smallest characteristic property. 23. A method for assigning at least one item to a batch according to any of claims 20-22, further comprising the step of arranging the batches ascending, least batch shortage first, 30 after test-assigning and wherein the batches selected for test-fitting are selected sequentially starting with the batch having the least batch shortage. 24. A method for assigning at least one item to a batch according to any of claims 20-23, wherein the imaginary items of the group of items are being provided by a retrospective 35 method. 25. A method for assigning at least one item to a batch according to claim 24, wherein the imaginary items being provided by the retrospective method are being provided so that the imaginary items of the group of items have substantially the same characteristic 5 property/properties as the items assigned most recently. 26. A method for assigning at least one item to a batch according to any of claims 20-23, wherein the imaginary items of the group of items are being provided by a simulation method. 10 27. A method for assigning at least one item to a batch according to claim 26, wherein the simulation method comprises the characteristic properties/property being simulated according to an empirical distribution of the characteristic property/properties of the items assigned most recently. 15 28. A method for assigning at least one item to a batch according to any of the claims 20- 23, wherein the imaginary items of the group of items are being provided by a scenario method. 20 29. A method for assigning at least one item to a batch according to claim 28, wherein the items being provided by the scenario method is being provided so that the histogram of the imaginary items is substantially the same as the histogram/empirical of the distribution of the characteristic property/properties of the items assigned most recently 25 30. A method according to any of claims 20-29, wherein the item assignment is a food stuff item such as fish, meat or the like. 31. A method for batching items by a measure into a group of batches comprising at least one batch according to one or more characteristic property of the item (such as weight, 30 volume, size, colour and/or number) by applying the assigning method according to any of claims 20-30, which method comprises the steps of: ■ conveying the item(s) from a first to a second location, the second position being either a batch or a rejection position; 35 ■ detecting one or more of the characteristic property of the items as they are being conveyed; ■ assigning, if possible, the detected item(s) to a batch, the assignment is based on the one more detected characteristic property/properties; ■ conveying the item(s) to the batch to which the item(s) is /are assigned if the item(s) is/are assigned to a batch, or ■ conveying the item(s) to a rejection position if the item(s) is/are not assigned to a batch. 32. A method for batching items by a measure into groups of batches according to claims 1 -19 or 31 , wherein the items are food stuff items such as fish, meat or the like. 33. An apparatus for batching food items into batches, said apparatus comprising: - a conveyor for conveying the food items from a in-feed area to a grading area and into a selected batch - a processor for processing data related to the weight of the food items so as to perform the method of batching according to claim 1-32.

Inventors: JENSSON PALL, JENSSON, PALL
Applicants: JENSSON PALL, MAREL HF, JENSSON, PALL, MAREL HF.
Application year: 2000
Main classification: G01G
IPC codes: G01G19