# Integrated Design of Process-Tolerance for Remanufacturing Based on Failure Feature
## 2 Materials and Methods
### Optimization Implementation Process of BAS  
IDP-T needs to comprehensively consider cost and quality loss in the design stage, while being constrained by closed-loop accuracy and machining capacity, which is a typical multi-objective and multi-constraint optimization problem. The general method to deal with this kind of problem is to transform it into a single-objective problem and find the optimal value of the model through multiple solutions; the convergence rate is slow and difficult to guarantee the optimality of the solution. Considering the shortcomings of traditional methods, we use the Beetle Antennae Search (BAS) to optimize the model.  
Beetle Antennae Search (BAS) is an intelligent algorithm proposed in 2017 [24], which simulates the foraging behavior of beetles in nature. Beetles find food by following odor information received through left and right antennae. By adjusting its direction according to odor intensity difference between antennas, the beetle finally finds food after several iterations.  
In order to increase the solving efficiency of BAS, some simplifications should be applied as follows:  
1. The beetle is simplified as a particle, and the left and right antennae are located on both sides of the particle.  
2. The ratio of the movement step size \(L_{step}\) to the distance between the antennas \(d0\) is constant, that is \(L_{step}=c\times d0\).
3. The head orientation of the beetle is random after one step. After completing the above simplification, the optimization process framework of BAS for IDP-T includes four steps: 1. Beetle position initialized. Select a group of solution in the optimization model of IDP-T solution space as the initial position of beetle \(x\). 2. Set left and right antennae and distance between two antennae. The fitness value \(F_{min}\) is obtained by the left and right antennae of beetles, represented by \(xl\) and \(xr\) respectively, and the difference value between the two antennae is represented by \(d0\). Since \(x\), \(xl\), \(xr\) are located in the same straight line, \(d0=norm(xl-xr)\). According to the simplified condition 3, the beetle faces in any direction, which means the direction vector that \(xl\) points to \(xr\) is arbitrary; thus, use the random vector \(dir=(x_{1},\ldots,x_{i},\ldots,x_{n})\) to represent this direction vector, and normalize by \(dir=dir/norm(dir)\). Therefore, \(xl-xr=d0\times dir\), when using the particle in simplifications condition 1, \(xl\) and \(xr\) can be expressed as \(xl=x+d0\times dir/2\) and \(xr=x-d0\times dir/2\), respectively. 3. The orientation and step size of a beetle. The corresponding fitness values of left and right antennae are represented by \(fleft=f(xl)\) and \(fright=f(xr)\) respectively. Then, the beetle moves with a step size of \(L_{step}\). The forward direction of the beetle is shown as Equation (20). 4. Output the optimal scheme and fitness. After comparing the fitness of the left and right tentacles for one step, the step size is updated in \(L_{step}=L_{step}\times eta\), where \(eta\) is the step size update factor [25]. When the precision requirement \(p\) or the specified number of steps \(n\) is reached, the beetle stops moving. When thee position of the beetle is the optimal solution of the model, then output position \(x\) with best scheme and corresponding fitness value \(F(x)\). The IDP-T optimization framework based on BAS is shown in Figure 4.  
Figure 4: IDP-T optimization framework based on BAS.