# A Multi-Objective Harmony Search Algorithm for Sustainable Design of Floating Settlements +
## 3 Generative Model and MOHS Algorithm  
The parametric model has been created in the Grasshopper (GH) [14] platform. GH is a part of Rhinoceros [15], a CAD program; it defines geometric entities and performs calculations on Rhinoceros with great ease through visual programming. The complete GH model can be seen in Figure 7.  
The MOHS algorithm has been programmed in the C-Sharp programming language. The necessary geometric and measurement operations required for formulating the objectives and constraints in our problem have been implemented in the Grasshopper design tool, which is a part of the Rhinoceros CAD product. This tool has been very useful in offering the necessary building blocks (such as the shortest path algorithm) for computationally implementing our problem. The C-Sharp algorithm makes use of this tool to calculate objective function values and constraint values. The summary of this process is shown in Figure 8.  
Figure 6: Shortest walk generation in GH model. Figure 7: Overview of the GH model [7]. In the generative model, the coordinates of the functions are defined first, then the functions are demonstrated with the circles with their specific areas. In the second stage, objective functions are formulized in the GH model. After setting up the constraints, the MOHS algorithm is implemented as a plug-in for the GH environment, as mentioned previously. After choosing a design from the set of design alternatives handled by the optimization, the shortest walk component was used in the GH environment to generate the streets between each function. As mentioned previously, the basic harmony search (HS) algorithm is developed in [8; 9]. It is a populated optimization method. The natural musical performance process is the key to the HS algorithm. This happens when a musician looks for a better state of harmony. In the HS algorithm, solutions are defined as harmonics and each harmony has an \(n\)-dimensional real vector. An initial population is randomly constructed as a harmony memory (HM). Then, generation of a new candidate harmony is achieved by all of the harmonies in HM through the use of a memory consideration, a pitch adjustment, and a random selection. Then, HM is updated by comparing the new harmony with the worst harmony vector in HM. This process is repeated until a certain termination criterion is met. There are five basic parameters in the HS algorithm. These are the harmony memory size (\(HM\)), the harmony memory consideration rate (\(HMCR\)), the pitch adjusting rate (\(PAR\)), the distance bandwidth (\(BW\)), and the termination criterion. Suppose that \(S_{i}=\left\{s_{i1},\ s_{i2},\ldots,s_{in}\right\}\) represent the \(i^{th}\) harmony vector in the harmony memory and \(s_{ij}\in\left[LB_{j},UB_{j}\right],\ j=1,2,\ldots,n\) where \(LB_{j}\) and \(UB_{j}\) are the lower and upper bound for each dimension \(j\), respectively. The HMS is the total harmonies in the memory as \(\left\{S_{1},S_{2},\ldots,S_{HMS}\right\}\). In other words, the population size is HMS. A harmony vector \(S_{i}=\left\{s_{i1},\ s_{i2},\ldots,s_{in}\right\}\) is randomly and uniformly generated as follows:  
\[s_{ij}=LB_{ij}+\left(UB_{ij}-LB_{ij}\right)\times U\left(0,1\right)\,\ j=1,2, \ldots,n \tag{28}\]  
where \(LB_{ij}\) and \(UB_{ij}\) are lower and upper bounds for each dimension j and \(U\left(0,1\right)\) is a uniform random number between 0 and 1 for each dimension (decision variables). Three rules are employed to improvise a new harmony vector, \(S_{new}\). These rules are a memory consideration, a pitch adjustment, and a random selection. As shown in Algorithm 1, a uniform random number \(U\left(0,1\right)\) is obtained. If \(U\left(0,1\right)\) is less than the \(HMCR\) probability, each dimension \(s_{new,j}\) is obtained by the memory consideration; otherwise, random selection is used and \(s_{new,j}\) is obtained by Equation (28). Memory consideration chooses any harmony \(a\) in the range \(\left\{1,2,\ldots HM\right\}\) as \(s_{new,j}=s_{a,j}\).