**4.4 Fitness function**

44 Woven Fabrics

0 0 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 0 0 1 0 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 0 0 1 0 0 1 1 0 0 1

(B)

Fig. 4. (A) The schematic weave for the twill weave (B) The strings of the 8-harness twill

(A)

Weft

A main difference between genetic algorithms and more traditional optimization search algorithms is that genetic algorithms work with a coding of the parameter set and not the parameters themselves (Goldberg, 1989). Thus, before any type of genetic search can be performed, a coding scheme must be determined to represent the parameters in the problem in hand. In finding weave pattern solutions, consisting of proper combination of the three variables, including weave structure (i.e., the combination of warp float and weft float), warp yarn color, and weft yarn color. A multi-parameter coding, consisting of three sub-strings, is required to code each of the three variables into a single string. In this study, a binary coding is utilized and the bit-sizes of the encoding for the three variables are as follows. In a direct problem representation, the weave pattern variables themselves are used as a chromosome. A list of weave structure/warp color/weft color is used as chromosome representation, which represents the permutation of patterns associated with assigned weave structure, warp color and weft color. A gene is an ordered triple (weave structure, warp color, and weft color). This

Cweftk ……. Cweft1 Cwarpj ….. Cwarp1 fi ……… f1

Weft color Warp color Weave structure

representation belongs to the direct way, which is sketched in Figure 5.

Fig. 5. Representation Scheme of Chromosome

weave

Warp

**4.3 Chromosome** 

In this study, the fitness function (i.e., evaluation function) is the user's preference. They are completely free for an operator to give a mark to the generated pattern without any restrictions depending on his/her being satisfied with it. GA is of an evolution capability based on the fitness value of each chromosome. The bigger the fitness of a chromosome is, the more probability it has to survive (be chosen). In other words, the gene (the feature) of the chromosome, which has bigger fitness than the others, will survive (be chosen) more easily to proceed with the operators, such as crossover, mutation, and reproduction, to create a brand new chromosome. Thus, the feature of the new generated chromosome will be inherited from the old chromosome composed of the required gene (i.e., feature). Moreover, each result of the generated chromosome for every generation can be reevaluated according to user's preference after examining the displayed pattern of weave structure decoded from generated parameters of WS, Cwarp, and Cweft1~Cweft8. By judging from the status of the displayed pattern, the user gives a mark (i.e., 0~1) to each of the pattern according to the satisfaction degree of each of them to the user. Thus, the fitness function is the user's preference and can be formed as Equation 6.

$$\text{Fitness(pattern)} = \text{User's preference(pattern)}\tag{6}$$

### **4.5 Example**

In this study, we use this system to search pattern parameters afforded to the predetermined specifications set as in Table 5, i.e., unit weave structure: 8 ends × 8 picks, the layout of warp yarn color is adopted as one color for simplification (if necessary, it can be set as various colors), and that of weft yarn is adopted as various colors. The desired pattern style is something like being of both the features of regular grid and interlacing twist.
