## 1. Introduction

Wine has been traditionally aged in barrels in many wine-growing regions around the world. This procedure improves the chemical and sensorial characteristics of the aged wines, thereby improving the quality of the resulting wine. During the aging process, the wine properties evolve due to the interaction between the wine compounds and the compounds released from the wood, and the oxygen that enters through the barrel is a key factor in wine evolution.

The barrel making process is a traditional procedure in which several staves are combined to build a barrel. This process has been traditionally performed by considering the shape of the barrel, its capacity, and the wood that is used, which are design parameters that have changed throughout history and vary across wine-producing regions [

1]. Moreover, barrel shape and size have been mathematically modeled in the literature to relate the barrel volume [

2,

3] and its surface area [

4] with the dimensions of the barrel staves. The problem of selecting the staves for the construction of a barrel can be regarded as a mathematical multiobjective optimization problem that can be divided into two sub-problems. The first sub-problem is selecting a set of staves with a total width equal to the width of the barrel body, with at least one stave having sufficient width for the barrel bung. The second sub-problem is selecting two sets of staves that fulfill the size requirements of the barrel heads. Currently, this procedure is performed by an expert worker (Master Cooper), who chooses the staves for the construction of each barrel without any technological aid. Moreover, only the geometrical characteristics of the staves are considered in the selection of the staves; other wood properties, such as the oxygen transmission rate (OTR), are not considered.

Several authors have analyzed the relations between the wood and the gas permeation under a pressure difference [

5,

6,

7,

8,

9,

10,

11], although very few studies refer to the transverse permeability of wood to gases as being the driving force of the oxygen concentration or consider the influence that the moisture level of the wood exerts on this gaseous flow [

12,

13,

14,

15,

16,

17], which is the real scenario in a barrel oak stave. The work of Nevares et al. [

18] showed that despite the strong role of the anatomical characteristics of

Quercus petraea wood, these characteristics are not sufficient for fully explaining the capacity for transferring oxygen or the variability in this transmission rate (OTR) via the simple correlations that have been studied. Nevertheless, Martínez-Martínez et al. [

19] proposed a method for estimating the OTR of oak wood samples via nondestructive methods that are based on artificial neural networks in consideration of not just one but many of the anatomical features of the oak wood. Moreover, this method could be implemented in a cooperage because the required equipment and processing time enable its use in a production line. Moreover, the work of Prat-García et al. [

4] demonstrated that there are significant differences in the permeation to oxygen among the low-OTR and high-OTR barrels that are constructed by applying this method. Therefore, to implement these previously obtained scientific results on a cooperage production line, it will be necessary for an automatic staves selection method to construct barrels with a desired OTR taking into consideration the OTR of the staves.

Several methods are available for automating the resolution of multiobjective optimization problems. The first group of methods are brute-force (BF) based methods, which evaluate all the possible solutions and choose the best solution. BF-based methods find the best solution for the problem, but they have higher computation and time requirements compared with other methods, which render them unsuitable for use in complex problems. For this reason, these methods have been used in many fields, but always as a part of a more complex method or with modifications that improve their performance when the complexity of the problem increases [

20]. The second group of methods are the Monte Carlo (MC) approaches [

21], which evaluate solution candidates that have been randomly chosen from the solution set and selects the best solution among all evaluated candidates. Compared with BF-based methods, MC methods can find satisfactory solutions in less processing time. Nevertheless, when the complexity of the problem increases, more complex methods are needed to find satisfactory solutions to the problem in a reasonable processing time. Artificial intelligence (AI)-based methods are one of the best options for solving multiobjective nonlinear optimization problems, improving the performance of BF- and MC-based methods. Examples of AI-based methods include ant colony optimization [

22], artificial bee colony [

23], harmony search [

24], particle swarm optimization (PSO) [

25,

26] and genetic algorithms (GAs) [

27,

28]. GAs are some of the most frequently used AI-based methods due to their flexibility and performance in modeling all types of processes. Related to the work that is presented in this article, GA-based methods have been applied in the development of several industrial applications to increase the productivity [

29]. Furthermore, GA-based methods have been used in industrial application for quality control and defect detection [

30,

31], to solve packaging problems [

32,

33] and to forecast production [

34,

35,

36] and energy demand [

37]. Moreover, GA-based algorithms have been used in the wine field: Burratti et al. combined electronic nose, electronic tongue and spectrophotometric measurement data for the prediction of sensorial descriptors [

38]; Beltrán et al. used GAs to extract features from high-performance liquid chromatograph data for the classification of Chilean wines [

39]; Cao et al. predicted pH and soluble solids content and discriminated the variety of grapes with a non-destructive method based on visible and near-infrared (Vis-NIR) spectroscopy [

40]; Corcoran et al. used GAs to reduce the number of parameters that were obtained from multisensor arrays of sensors for the classification of wine samples [

41]; and Kuo and Lin combined a GA and a PSO algorithm for clustering [

42].

In this paper, GA-based methods for selecting the staves for the construction of a barrel are proposed. These methods consider not only the geometry of the staves, but also their OTR in the construction of barrels with a desired global OTR. The performance of the proposed method was analyzed with the data of 3064 oak wood staves, and it was compared with the performance of the method that is currently used in several cooperages and a MC-based approach to evaluate the improvement of the proposed method.

## 2. Materials and Methods

#### 2.1. Oak Wood Samples

For the experiment, 3064 French oak (

Q. petraea) fresh staves, which were provided by INTONA S.L. cooperage (Navarra, Spain) and were selected from among the oak samples that they use to construct regular barrels, were used to characterize the fresh stave population of this cooperage. The selection of these samples was conducted to obtain a representative sample of the wood that is used by this cooperage, and staves were selected from different batches and with various characteristics. These staves, which were widely analyzed in the work of Prat-Garcia et al. [

4], were divided into 1836 fresh staves, with a length of approximately 96 cm, for the barrel body, and 1228, with a length of between 42 and 73 cm, for the barrel head, and a “grain” (width of the annual growth ring) value of between 1.88 and 4.94 mm. The OTR value of all the samples, which were measured by employing the ANN-based method of Martínez-Martínez et al. [

19], and the widths of the body staves or the widths and lengths of the head staves were used as the dataset for the method evaluation that is presented in this article. A wider analysis of these samples can be found in the article of Prat-Garcia et al. [

4].

In the real cooperage simulation experiment, where more samples than those available were necessary, the cumulative distribution function (CDF) of the features was used to generate the samples that were used in this experiment. Thus, the length, width and OTR data of the head staves and the length and OTR data of the body staves were regarded as representative of the cooperage stave population. Therefore, they were used to calculate their five associated CDFs. Then, three and two random vectors were initialized for the heads and bodies, respectively, with as many elements for each vector as head samples and body samples as were needed in each case. These random vectors were obtained from a continuous uniform distribution with values between zero and one. Finally, the CDFs of each feature were used to calculate the feature values from the random value vectors by using a linear interpolation to estimate the values for which the CDFs were not defined.

#### 2.2. Barrel Construction Process

The barrels that are used to age beverages have three parts: the heads, which are the two circle parts; the body, which is the larger part that links the two heads; and the bung, which enables the barrel to be filled or emptied. Each cooperage company has its own procedure for constructing barrels with various shapes, volumes and properties. Nevertheless, the barrel construction process can be divided into three subprocesses: the barrel head construction process, the barrel body construction process and the barrel head and body assembly process. In the next paragraphs, the process that is used in this article will be explained.

A set of staves are needed for the construction of a circle of 597 mm in diameter in the head’s construction process. Thus, the length and width of the staves should be sufficient for constructing this circle. Another structural requirement is an odd number of staves so that there is one stave in the middle of the head. It makes that the number of staves employed to build a barrel head is, typically, 7, 9 or 11 staves. The order of the staves is relevant in the barrel construction because the length of the central stave of the head is larger than those of the staves of the extreme positions of the head.

There are two main requirements in the body construction process: at least one stave that is wider than 10 cm is needed for the placement of the barrel bung hole, and the total width of the staves must be 218 cm in a 225-L Bordelaise barrel. The number of staves needed to build a barrel body is around 30, but it can vary depending on the width of the staves employed. In the body construction process, in contrast to the head’s construction process, the position of the staves is not relevant. Some cooperages distribute the body staves by interleaving narrow and wide staves; however, this restriction was not considered in the barrel body GA method because the stave distribution does not affect the final OTR, as will be explained below. Thus, the cooper could choose from a set of staves to build a body barrel in which narrow and wide staves are interleaved, distributed randomly, or arranged using another criterion.

Finally, the barrel head and body assembly process consist of the assembly of two heads and a body to build the barrel, and there are no structural requirements regarding the parts to be assembled in this process.

## 4. Results and Discussion

Several scenarios were simulated to analyze the proposed stave selection method. These scenarios correspond to cases that could occur in a cooperage with the OTR of all the staves calculated or estimated. The next subsections will evaluate the performance of the proposed method in these scenarios.

#### 4.1. Barrel Homogenization

One possible application of the proposed method is the homogenization of the OTR of the barrels that are constructed in a cooperage. Currently, the staves of the barrel are chosen randomly, which leads to a significant OTR variance among the resulting barrels.

Thus, in this first scenario, the objective of the stave selection method will be the creation of heads and bodies with OTRs that are similar to the mean OTRs of all the head and body staves, respectively. The proposed GA-based selection methods were simulated and compared with the

current and the MC-based selection methods. The target OTR values for the MC-based and the GA-based methods were chosen as the mean OTR values for the body and the head staves, which are 0.03275 and 0.02928 hPa/h, respectively, as calculated in [

4]. The construction of 50 barrels (50 body staves and 100 body heads) was simulated with various numbers of staves and various processing times in the selection method.

Table 2 and

Table 3 present the obtained results for the heads and bodies construction simulation respectively. Moreover,

Figure 7 and

Figure 8 show the performance of both MC-based and GA-based methods when the target OTR varies.

Analyzing the results in

Table 2 and

Table 3, several observations are made. Analyzing the mean value of the bodies and heads, these values are close to the target OTR in the three methods. This finding could be explained by the central limit theorem that denotes that the mean value of the barrels and bodies will be close to the mean value of the staves even for the

current method, in which the OTR is not considered in the construction of the barrel element. However, analyzing the coefficient of variation there are differences among the methods considered. First, there are large differences between the coefficient of variation for the

current method and the coefficients of variation for the MC and GA methods, which is expected because the latter two methods consider the OTR of the staves in the barrel element construction. Moreover, this coefficient of variation, which is between 14% and 17% for the heads and between 6% and 9% for the bodies, is an approximation of the actual variance of the barrels that are constructed in a cooperage. The second observation in comparing the methods is that, despite the small coefficients of variations for the MC and GA methods, there is a consistent difference between them: the coefficient of variation for the GA-based methods is always smaller. Furthermore, the GA-based compared with the MC-based methods performance is better when the absolute difference between the OTR and the mean OTR increases, as it can be seen in

Figure 7 and

Figure 8. This observation shows the utility and robustness of the proposed GA-based methods.

Comparing the simulation parameters that are considered for the MC and GA methods, increasing the simulation time reduces the variability of the constructed elements because the construction methods have more time to perform iterations and the probability of finding better solutions increases. Nevertheless, increasing the number of iterations increases the processing time of the method, which is an undesirable feature of the method. Moreover, analyzing the number of staves that are considered in the method, the variability is reduced as the number of staves increases because it is easier to find staves with satisfactory characteristics for the construction of an element, but the increment of the staves makes the process more complex to implement in a cooperage due to the storage and the logistical requirements that are associated with this modification. For these reasons, choosing the iteration time and the number of staves is a compromise solution. In the next experiments of this article, we are going to use an iteration time of 1 s, 50 staves for the head stave selection method, and 100 staves for the body stave selection method.

Finally, by comparing the construction of the heads and bodies, interesting differences are identified. The coefficient of variation for the heads is larger than the coefficient of variation for the bodies for the current method. This finding could be explained by the bodies having approximately 3 times more staves than the heads; hence, the variance when a set of staves is randomly chosen decreases when the number of staves increases. Nevertheless, it is difficult to draw a similar conclusion when comparing the MC-based and the GA-based methods. In these cases, there are differences among the stave selection criteria that are considered that render impossible the comparison of the head and the body construction methods in the same conditions to analyze the differences of the obtained coefficient of variation values.

#### 4.2. Low-OTR and High-OTR Barrel Production

The second scenario was proposed to construct low-OTR (L-OTR) and high-OTR (H-OTR) barrels in the regular production of a cooperage. The body and the head staves were preclassified into three groups of staves each: low-OTR, mid-OTR, and high-OTR body and head staves, respectively, repeating the strategy of Prat-García et al. [

4] by using the OTR estimation method proposed in [

19]. In our work, the threshold values that were considered in the formation of the groups were 0.0157 and 0.0396 hPa/h for the body staves and 0.0230 and 0.0434 hPa/h for the head staves, which were the same threshold values utilized in the work of [

4].

After preclassifying the staves, the proposed methods were applied to homogenize the OTR of the constructed barrels in a similar way to the procedure followed in the first scenario. The previously selected parameters of 25 and 50 staves for the head and body construction methods, respectively, were chosen, and a maximum iteration time of 1 s was set in both cases. Moreover, the target OTR value was chosen as the mean OTR value of the staves that were considered in each case, which was 0.0148985 and 0.0165681 hPa/h for the L-OTR head and body, respectively, and 0.0501335 and 0.0528710 hPa/h for the H-OTR head and body, respectively.

Table 4 presents the obtained results for the L-OTR and the H-OTR barrels, while

Figure 9,

Figure 10,

Figure 11 and

Figure 12 show the performance of MC-based and GA based methods when the target OTR varies.

First, analyzing the obtained results and comparing them with the results in

Section 4.1, several observations from the previous subsection are also valid for this experiment: the evaluated MC and GA methods significantly reduce the variability of the constructed elements according to a comparison of their coefficients of variation with those obtained by the

current method. Moreover, the proposed GA methods improve the performance of the MC methods, being also more robust to changes in the target OTR.

Second, the obtained results demonstrate the advantages of preclassifying staves as L-OTR and H-OTR. Comparing the obtained results with those presented in

Figure 7 and

Figure 8, preclassifying staves is the best strategy if the construction of barrels with two OTR levels is the objective. The first reason to justify it is the high error rate obtained in

Figure 7 and

Figure 8 for the extreme OTR values. The second reason is that it is possible to construct L-OTR and H-OTR barrels via the

current selection method. Nevertheless, the difference in the variability that is presented in

Table 4 suggests that the proposed GA-based method should be implemented.

Third, the L-OTR and the H-OTR barrels differ as follows: the coefficients of variation are smaller for the H-OTR heads and bodies. This is mainly due to the difference in the mean OTR values, which are between 3 and 4 times greater for the H-OTR elements; hence, the variability, which is regarded as the standard deviation, is larger for the H-OTR barrel elements.

#### 4.3. Real Cooperage Simulation

The last scenario that was considered in the evaluation of the proposed method was the production of 50 wine barrels, which is a regular daily production of cooperages such as INTONA S.L. cooperage. Fifty L-OTR and 50 H-OTR barrels with the same characteristics as in experiment 4.2 were constructed: 25 and 50 staves were regarded as the method dataset for the head and the body construction methods, with a maximum iteration time of 1 s and target OTR values of 0.0148985 and 0.0165681 hPa/h for the L-OTR head and body, respectively, and 0.0501335 and 0.0528710 hPa/h for the H-OTR head and body, respectively. These configuration parameters are the same as those that were chosen in the previous scenarios.

The method procedure was similar to the procedures for the previous scenarios but with the generation of 100 heads or 50 bodies per simulation instead of one. 2000 L-OTR and 2000 H-OTR stave samples for both the head and the body were considered, which were generated based on the CDF of the features of the original data according to the procedure that is described in

Section 2.1. These samples were organized as presented in

Figure 6; hence, at the beginning of the experiment, all the staves were in the idle stave dataset. From this dataset, 25 or 50 staves for the heads or the bodies, respectively, were randomly extracted to the method construction stave dataset for the construction of a head or a body. After the stave selection methods had been executed, the selected staves were moved to the used stave dataset, and the remaining staves were moved to the idle stave dataset. This procedure was iteratively repeated until all the heads and bodies were constructed, and it was applied for both the MC-based methods and the GA-based methods.

The 2000 samples of each experiment were randomly ordered at the beginning of the experiment in an ordered queue. With this randomly initialized queue for the idle stave dataset, the method construction stave dataset always selected the first 25 or 50 staves of this queue and moved the unused staves after the application of the method to the last position of the idle stave dataset queue. This procedure was applied to the MC-based methods and the GA-based methods with the same initial idle stave dataset queue to obtain similar conditions and to avoid differences in the comparison that are due to differences in the orders of the dataset. Moreover, the proposed queue simulates the production line of a cooperage; hence, it could be implemented on the production line.

Table 5 presents the results that were obtained in this experiment. These results provide an example of the performance that could be realized by the proposed methods in a real cooperage.

The first observation is that the GA-based methods outperform the MC-based methods in the real simulation.

The second observation regards the homogeneity of the obtained barrels. On the one hand, it can be seen that the coefficient of variation is very low, which is an important parameter for the homogeneity. On the other hand, when analyzing the worst cases, the homogeneity is again highly satisfactory: the variation range between the minimum and the maximum OTR values of the barrels is less than 1.3% with respect to the mean OTR.

The last observation regards the head and body assembly procedure. In this scenario, each barrel was constructed with the first available body and heads, e.g., the first barrel with the first body and the first and second heads and the second barrel with the second body and the third and fourth heads. It will be possible to reduce the variability of the resulting barrels by selecting the heads and bodies that are used to build each barrel to compensate the OTR values of the elements of the barrels. Nevertheless, implementing this procedure in a real cooperage will be difficult because it will be necessary to store several heads and bodies and to manage them for its assembly; it may not be worth applying this approach because sufficiently low variability can be realized without using this method.