Research Article

Optimal Allocation and Control of Magnetorheological Dampers for Enhancing Seismic Performance of the Adjacent Structures Using Whale Optimization Algorithm

Table 2

The pseudocode of Step 9 of the design process.

Update each position Xi with the following steps:
Update the algorithm parameters including a, b, A, C, l, and p defined in Section 3
Judge whether p < 0.5
If yes,
   Judge whether , which is defined in Section 3
   If yes,
     randomly determine a position in the range of the current population, and update the position Xi according to equation (19)
   else
     update the position Xi based on according to equation (14)
   end
else
   conduct spiral position updating according to equation (17)
end
Judge whether every code of the position Xi is within the predefined value ranges
If yes,
   keep the position Xi
else
   replace the code of the position Xi with the corresponding limit value
end
t = t + 1