Fig. 2 Calculating distance by ultrasound sensor [66] 图 2 通过超声波传感器计算距离 [66]
from the prey; Dist _Fox _ Prey _(it)_{i t} can be calculated by using Dist _ S_(-)T_(it)S_{-} T_{i t}. Therefore, to calculate the distance between sensor and object in physics, the distance of sound travels is divided by 2 since the distance between the sensor and the object is one-half of the distance that has been found by the sound wave [66]. Fig. 2 presents the sensor, which sends a sound wave signal to an object and then receives the signal. Therefore, the sensor multiplies the distance of the sound travels time by 0.5 or 1//21 / 2. Both multiplying by 0.5 or dividing by 1//21 / 2 is the same because half of the sound wave is considered [66]. So Eq. (3), is taken from techniques of sensors and objects to find the distance from Fig. 2: 从猎物那里;Dist _Fox _ Prey _(it)_{i t} 可以使用 Dist _ 计算 S_(-)T_(it)S_{-} T_{i t} 。因此,为了计算物理学中传感器和物体之间的距离,声音传播的距离除以 2,因为传感器和物体之间的距离是声波所发现距离的一半 [66]。图 2 显示了传感器,它向物体发送声波信号,然后接收信号。因此,传感器将声音传播时间的距离乘以 0.5 或 1//21 / 2 。乘以 0.5 或除 1//21 / 2 以都是相同的,因为被认为是声波的一半 [66]。因此,方程 (3) 取自传感器和物体的技术,以求出与图 2 的距离:
After finding the distance between a fox and the prey, the red fox needs to find a new position so that the red fox requires to jump to catch the prey. Therefore, the fox needs to calculate the jump height Jump _(it)_{i t}. Thus, Jump _(it){ }_{i t} can be calculated by the following equation: 找到狐狸和猎物之间的距离后,红狐需要找到一个新的位置,这样红狐需要跳跃才能抓住猎物。因此,狐狸需要计算跳跃高度 Jump _(it)_{i t} 。因此,Jump _(it){ }_{i t} 可以通过以下公式计算:
Jump _(it)=0.5**9.81**t^(2)_{i t}=0.5 * 9.81 * t^{2} 跳 _(it)=0.5**9.81**t^(2)_{i t}=0.5 * 9.81 * t^{2}
Where 9.81 is the acceleration due to gravity and tt is equal to the average time that sound takes to travel and it is squared because of the up and down steps in the jump. The time transition ttt t value is calculated by dividing the sum of the Time S_(-)T_(it)S_{-} T_{i t} to dimensions. Equation (7) shows the ttt t and Min T\operatorname{Min} T calculation. Then average time tt is found by dividing ttt t by 2 . The average time and gravity are multiplied by 0.5 because the jump value takes two different times to go up and down. As a result, both gravity and average time must be multiplied by 0.5 . Then, the Jump value is multiplied by Dist _Fox _ Prey i_(it)i_{i t} and c_(1)c_{1}. The variable c_(1)c_{1} has a range, which is within [0,0.18][0,0.18] when the red fox jumps to the northeast direction. The equation below shows the 其中 9.81 是重力加速度, tt 等于声音传播所需的平均时间,并且由于跳跃中的上下台阶而成为平方。时间转换 ttt t 值的计算方法是将 Time S_(-)T_(it)S_{-} T_{i t} to dimensions 的总和除以。方程 (7) 显示了 ttt t 和 Min T\operatorname{Min} T 计算。然后通过除 ttt t 以 2 来找到平均时间 tt 。平均时间和重力乘以 0.5,因为跳跃值需要两个不同的时间来上升和下降。因此,重力和平均时间都必须乘以 0.5 。然后,Jump 值乘以 Dist _Fox _ Prey i_(it)i_{i t} 和 c_(1)c_{1} 。该变量 c_(1)c_{1} 有一个范围,该范围在红狐跳到东北方向时。 [0,0.18][0,0.18] 下面的等式显示了
calculation of the new position of the red fox if the pp, which random number in the range [ 0,1 ], is greater than 0.18 . 如果 pp ,在 [ 0,1 ] 范围内的随机数大于 0.18 ,则计算红狐狸的新位置。 X_((it+1))=X_{(i t+1)}= Dist_Fox_Prey _(it)^(**)_{i t}{ }^{*} Jump _(it)^(**)c_(1)_{i t}{ }^{*} c_{1} X_((it+1))=X_{(i t+1)}=_(it)^(**)_{i t}{ }^{*} Dist_Fox_Prey Jump _(it)^(**)c_(1)_{i t}{ }^{*} c_{1}
Both Eqs. (5) and (6) are used to find a new location for the red fox. Only one of them is executed in each iteration because of using the pp condition. However, the only difference is in the second part of the pp condition in Eq. (5). If the else condition of the pp is different, the Eq. (5) is multiplied by c_(2)c_{2} instead of c_(1)c_{1} if the value of pp is less than or equal to 0.18 . Therefore, if the pp is greater than 0.18 , then the new position is calculated by Eq. (5). However, if the value is less than 0.18 , then the new position is calculated by Eq. (6). The range of c_(2)c_{2} is within [0.19, 1]. 两个方程。(5) 和 (6) 用于为 Red Fox 寻找新位置。由于使用了 pp condition,因此在每次迭代中只执行其中一个。然而,唯一的区别是在方程 (5) 中 pp 条件的第二部分。如果 的 pp else 条件不同,则方程 (5) 乘以 c_(2)c_{2} 而不是 c_(1)c_{1} 如果 的值 pp 小于或等于 0.18 。因此,如果 大于 pp 0.18 ,则新位置由方程 (5) 计算。但是,如果该值小于 0.18 ,则新位置由方程 (6) 计算。的范围 c_(2)c_{2} 在 [0.19, 1] 范围内。 X_((it+1))=X_{(i t+1)}= Dist_Fox_Prey _(it)^(**)Jump_(it)**c_(2)_{i t}{ }^{*} \mathrm{Jump}_{i t} * c_{2} X_((it+1))=X_{(i t+1)}=_(it)^(**)Jump_(it)**c_(2)_{i t}{ }^{*} \mathrm{Jump}_{i t} * c_{2} Dist_Fox_Prey
The value of c_(1)c_{1} and c_(2)c_{2} are 0.18 and 0.82 respectively. These values are based on the jump movement of a red fox, which is either jumps to the northeast or opposite. Therefore, if the pp value is greater than 0.18 , it means that the red fox jumps to the northeast direction. Consequently, to find a new position both Dist _Fox _ Prey _(it)_{i t} and J_(ump)^(it)J_{u m p}^{i t} are multiplied by c_(1)c_{1}. Accordingly, chances of exploiting a new position are great and the red fox goes toward global optima. However, the red fox jumps in the opposite of northeast direction, if the pp value is less than 0.18 , this means that the chances of killing prey are low (%18). Hence, both Dist _Fox _ Prey _(it){ }_{i t} and J_(ump)_(it)J_{u m p}{ }_{i t} are multiplied by c_(2)c_{2}. c_(1)c_{1} 和 c_(2)c_{2} 的值分别为 0.18 和 0.82。这些值基于红狐的跳跃运动,即向东北方向或相反方向跳跃。因此,如果该值 pp 大于 0.18 ,则表示红狐向东北方向跳转。因此,为了找到一个新位置,Dist _Fox _ Prey _(it)_{i t} 和 乘 J_(ump)^(it)J_{u m p}^{i t} 以 c_(1)c_{1} 。因此,利用新位置的机会很大,红狐狸走向全局最优。但是,红狐向东北方向的相反方向跳跃,如果该值 pp 小于 0.18,则表示杀死猎物的几率很低(%18)。因此,Dist _Fox _ Prey _(it){ }_{i t} 和 J_(ump)_(it)J_{u m p}{ }_{i t} 都乘 c_(2)c_{2} 以 。
2.3.2 Exploration 2.3.2 探索
To control the random walk, the fox searches randomly in this phase according to the best position of the fox that has been found so far. The fox does not have a jumping technique in this phase because it has to walk randomly to explore prey in 为了控制随机游走,狐狸在这个阶段根据目前已经找到的狐狸的最佳位置随机搜索。狐狸在这个阶段没有跳跃技术,因为它必须随机行走才能探索猎物
Fig. 3 Flowchart of FOX 图 3 FOX 的流程图
the search area. To ensure that the fox walks randomly toward the best position, a minimum time variable MinT and the variable aa are used to control the search. Equations (7) and (8) show the calculation of the Min T\operatorname{Min} T and variables. Min T\operatorname{Min} T is calculated by finding the minimum of ttt t. 搜索区域。为了确保狐狸随机走向最佳位置,使用最小时间变量 MinT 和变量 aa 来控制搜索。方程 (7) 和 (8) 显示了 Min T\operatorname{Min} T 和 变量的计算。 Min T\operatorname{Min} T 通过查找 的最小值来计算 ttt t 。 tt=(sum(" Time "_(S_("Tit "))(i,:)))/(" dimension "),Min T=Min(tt)t t=\frac{\operatorname{sum}\left(\text { Time }_{S_{\text {Tit }}}(i,:)\right)}{\text { dimension }}, \operatorname{Min} T=\operatorname{Min}(t t)
Summation of Time S_(-)T_(it)(i,:)S_{-} T_{i t}(i,:) is divided on the dimension of the problem to find the minimum time average tt. 时间 S_(-)T_(it)(i,:)S_{-} T_{i t}(i,:) 总和在问题的维度上除以求最小时间平均值 tt 。
a=2**(it-((1)/(" Max "_(it))))a=2 *\left(i t-\left(\frac{1}{\text { Max }_{i t}}\right)\right)
Where Max _(it)_{i t}, is the maximum iterations. Calculating both Min T\operatorname{Min} T and aa variable has a vital effect on the search phase to move toward the solution that is close to the best solution. 其中 Max _(it)_{i t} 是最大迭代次数。计算 和 Min T\operatorname{Min} Taa 变量对搜索阶段有至关重要的影响,以朝着接近最佳解决方案的解决方案前进。
Using rand(1, dimension) to ensure that the fox walks stochastically to explore the prey. However, to strengthen the searchability of FOX both Min T\operatorname{Min} T and aa variable are used. Variable rr, which is a random number, is also used to balance the exploration and exploitation phases. The best solution Best X_(it)X_{i t} that has been found so far has a great impact on the exploration phase. Eq. (9) shows the exploration technique of the fox in searching for a new position in the search space X_((it )X_{\text {(it }} +1 . The equations in this phase can be adapted to existing algorithms to enhance their performance. They can also be used to propose new metaheuristic algorithms. 使用 rand(1, dimension) 确保狐狸随机行走以探索猎物。但是,为了加强 FOX 的可搜索性,同时使用 Min T\operatorname{Min} T 了 和 aa variable。Variable rr 是一个随机数,也用于平衡勘探和开发阶段。到目前为止找到的最佳解决方案 Best X_(it)X_{i t} 对勘探阶段有很大影响。方程 (9) 显示了 fox 在搜索空间中 X_((it )X_{\text {(it }} 搜索新位置 +1 的探索技术。此阶段的方程可以适应现有算法以提高其性能。它们还可用于提出新的元启发式算法。 X_((it+1))=BestX_(it)**rand(1X_{(i t+1)}=\operatorname{Best} X_{i t} * \operatorname{rand}(1, dimension )**MinT**a) * \operatorname{MinT} * a X_((it+1))=BestX_(it)**rand(1X_{(i t+1)}=\operatorname{Best} X_{i t} * \operatorname{rand}(1 尺寸 )**MinT**a) * \operatorname{MinT} * a
The equations in both phases do not need any modification rather than adaptation to a specific problem while FOX is used to solve the multidimensional space problem. The details of the FOX can be seen in Algorithm 1 and Fig. 3. 这两个阶段的方程都不需要任何修改,而不需要适应特定问题,而 FOX 用于解决多维空间问题。FOX 的详细信息可以在算法 1 和图 3 中看到。
Algorithm 1 FOX optimization algorithm
Initialize the red fox population \(\boldsymbol{X} i(i=1,2, \ldots ., n)\)
While it<Maxit
Initialize Dist_S_T, Sp_S, Time_S_T, BestX, Dist_Fox_Prey, Jump, MinT, a, BestFitness.
Calculate the fitness of each search agent
Select BestX and BestFitness among the fox population \((X)\) in each iteration.
If1 fitness \({ }_{i}>\) fitness \(_{\boldsymbol{i}+1}\)
BestFitness=fitness \(\boldsymbol{s}_{\boldsymbol{i}+\boldsymbol{1}}\)
Best \(X=X(\) i, :)
Endif1
If2 \(r>=0.5\)
If3 \(p>0.18\)
Initialize time randomly;
Calculate Distance_Sound_travels using Eq. (1)
Calculate \(S p \_S\) from Eq. (2)
Calculate distance from fox to prey using Eq. (3)
\(\mathrm{Tt}=\) average time;
\(\mathrm{T}=\mathrm{Tt} / 2\);
Calculate jump using Eq. (4)
Find \(\boldsymbol{X}_{(i t+1)}\) using Eq. (5);
Elseif \(p<=0.18\)
Initialize time randomly;
Calculate Distance_Sound_travels using Eq. (1)
Calculate \(S p\) _S from Eq. (2)
Calculate distance from fox to prey using Eq. (3)
\(\mathrm{Tt}=\) average time;
\(\mathrm{T}=\mathrm{Tt} / 2\);
Calculate jump using Eq. (4)
Find \(\boldsymbol{X}_{(i t+1)}\) using Eq. (6);
EndIf3
else
Find MinT using Eq. (7)
Explore \(\boldsymbol{X}_{(i t+1)}\) using Eq. (9)
EndIf2
Check and amend the position if it goes beyond the limits
Evaluate search agents by their fitness
Update Best \(X\)
\(i t=i t+1\)
End while
40: return BestX \& BestFitness
Overall, FOX begins by initializing the population of the red fox randomly. Then, in the first iteration, the population is checked whether the position of each red fox is inside the boundary of the benchmark function or not. After that, the fitness value of the benchmark function is calculated based on the row of the population. Following these steps, the BestFitness value and the best position (BestX) are selected. Then, a condition is started by comparing the random number rr. If it is greater than or equal to 0.5 , then the exploitation phase is activated. Also, a pp condition exists inside the exploitation phase. If the pp value is greater than 0.18 , then the new position of the red fox is found based on Eqs. (1), (2), (3), (4), 总体而言,FOX 首先随机初始化红狐的种群。然后,在第一次迭代中,检查种群是否每个红狐狸的位置在基准函数的边界内。之后,根据总体的行计算基准函数的适应度值。按照这些步骤,选择 BestFitness 值和最佳位置 (BestX)。然后,通过比较随机数 rr 来启动条件。如果它大于或等于 0.5 ,则激活利用阶段。此外,利用阶段中存在一个 pp 条件。如果该值 pp 大于 0.18 ,则根据 Eqs 找到红狐狸的新位置。(1), (2), (3), (4),
and (5). However, if pp value is less than or equal to 0.18 , then the new position is calculated based on Eqs. (1), (2), (3), (4), and (6). If rr is less than 0.5 in the else condition, the exploration phase is activated. Therefore, the new position is found based on the best position, random number, and multiplying Min T\operatorname{Min} T variable by variable aa. Thus, the BestFitness is returned in the first iteration. After modifying the population, the same steps are done repeatedly in the second iteration to find the best fitness and best position. 和 (5)。但是,如果 pp value 小于或等于 0.18 ,则根据 Eqs 计算新位置。(1)、(2)、(3)、(4) 和 (6)。如果在 rr else 条件中小于 0.5,则激活探索阶段。因此,根据最佳位置、随机数和乘 Min T\operatorname{Min} T 以变量 aa 找到新位置。因此,在第一次迭代中返回 BestFitness。修改总体后,在第二次迭代中重复执行相同的步骤,以找到最佳适应度和最佳位置。
Regarding the computational complexity of FOX: each iteration, has a time complexity of OO (SearchAgents * D**itD * i t ) where SearchAgents is the population size, DD is the dimension 关于 FOX 的计算复杂度:每次迭代的时间复杂度为 OO (SearchAgents * D**itD * i t ),其中 SearchAgents 是群体大小, DD 是维度