## 2 Methodology of Proposed Formula  
Different models of buildings with various properties (values of mass and stiffness of each story) were analyzed in the study under different earthquakes. The CRVK (Coefficient of Restitution, Velocity and Stiffness) program was used so as to perform dynamic analyses and solve impact problems (see [33] for details). The CRVK program is a computer program based on MATLAB software. It is mainly focused on calculating lateral displacements, velocities and accelerations of bounding-involved responses of buildings, with a different number of stories and various values of mass and stiffness of each story, under different earthquake excitations. The program is also able to determine the critical distance between colliding structures exposed to ground motions, impact force during collisions, dissipated energy, etc. It allows us to depict all figures and curves, calibrate the models and compare the results. For some cases, special functions are also possible, including neural network analysis (see [33] for details).  
In order to create an algorithm predicting the maximum lateral structural displacements, a logical algorithm was also created. The process of such creation was divided into three basic steps: learning, validation and testing. The first step was devoted to obtaining a database that is necessary to build up the algorithm. Then, a numerical analysis, focused on collecting samples for the program, was conducted. In the last step, the created programs were presented. The maximum lateral displacements were calculated and listed for different earthquake records. The building vibration period of models (BVP), damping ratio of buildings (DR), lumped mass (LM), stiffness of each story (SS), maximum lateral displacements (MLD) and peak ground accelerations (PGA) were optimally defined as inputs and an iterative procedure was conducted by the CRVK program [33].  
All inputs were listed and approximately analyzed so as to calculate the maximum lateral displacements in order to design and estimate different trends based on internal weights, \(R_{1}\) and \(R_{2}\). These two internal weights depend on two parameters of each building, i.e., on the structural vibration period and on the structural damping ratio. Since they have different meanings, they should be collected in two various packages. In other words, each parameter is collected in a separate package, and then a rational weight is proportionally calculated for all parameters in each package. The total sum of all weights in each package is equal to one. For example, if there are three buildings with vibration periods equal to 0.25, 0.65 and 1.2 s (parameters collected in the first package), the internal weights, \(R_{1}\), are calculated as equal to 0.119, 0.310 and 0.571, respectively. On the other hand, if these three buildings have the same structural damping ratios (parameters collected in the second package) which are equal to 0.05, for example, the internal weights, \(R_{2}\), are identical and equal to 0.333. The CRVK program considers both packages in the analysis. The calibration continues until the moment when the optimum sample is found, and it is repeated so as to find the best match between all parameters.  
Applying the CRVK program, a new equation, based on the vibration periods and damping ratios of buildings, was suggested in order to calculate the gap size index and, consequently, the optimum separation distance between buildings during the whole time of an earthquake. The schematic architecture of the CRVK program model is presented in Figure 1.