What you read in this article:
Harmony Search :
What is harmony search?
Steps of harmony search algorithm
- Rae initial responses along with their evaluation and filling HM memory
- Production of a new harmony with the possibility of using HM Equal to HMCR
- Change the frequency with par or pitch rate adjustment probability as well as evaluate new responses
- Compare new harmony with the previous one and add it to HM if it is optimal
- Go back to step 2, if there is no stop bet.
Parameters of harmony search algorithm
- Maxlt: This parameter represents the values associated with the repetition of the algorithm.
- HMS: HMS or harmony memory size is a parameter that represents the amount of harmonies that are stored in memory.
- nNew: This parameter represents the amount of new harmonies that are made each time.
- HMCR: HMCR or harmony Memory Consider Rate is a parameter that shows the probability of using memory harmony. For example, if we put it at 0.5, it means that when creating a new harmony, there is a 50% chance that memory harmony will be used. This feature is almost identical to the selection feature in the genetic algorithm.
- PAR : PAR or Pitch Adjustment Rate is a parameter that shows the probability of minor changes in a component. This feature is almost identical to the mutation feature in the genetic algorithm.
- FW: FW or Fret Width is a parameter used for continuous problems. The name of this parameter is derived from fret or guitar or violin. The value of this parameter should be proportional to the distance between VarMax and VarMin, so we can say that the value of 0.05* (VarMax-VarMin) is almost significant. Instruments such as piano, unlike instruments such as guitars, do not have firth.
A more detailed description of harmony search algorithm
- This section includes the construction of a raw harmony and the acts of reproduction and …. On it. This harmony is able to store information about each response. Therefore, it is necessary to pour information into it further. This is a raw harmony of the main features of positon and cost, in which the cost corresponds to the position.
- This part is related to the proliferation of raw harmony 20 times. The reason for the repetition is that we put the HMS rate at 20.
- Depending on the nVar value, each response contains 5 different elements. These 5 elements are in the form of a matrix of 1 in 5. The members of this matrix are between -10 and 10. (Between VarMax and VarMin values). At this point, the capacity of raw harmony must be filled by random information. As a result, it is formed by repetition. The amount of this repetition is determined by HMS values. If we randomly form a 1-in-5 matrix and the members of this matrix randomly contain VarMax and VarMin values, the created responses will also be random. In this case, we can create random solutions by using unifrnd (a function of statistical tools). After producing these random answers, we evaluate them for their position.
- This step relates to the sorting of memory harmonies. This sorting should be based on cost. After this step, the first phase of the harmony search algorithm is finished.
- At this point, we save the best solution in BestSol. We also keep the best amount of cost until all repetitions are finished. In other words, until the end of the number of repetitions (MaxIt), each time, we store the best answer in BestSol.
- This step consists of a loop that is actually the main loop of the program and repeats as much as mentioned in the MaxIt parameter. In this case, we need to create an array for new harmonies. The above array has the capacity to hold new harmonies at the rate of nNew.
- Each time you repeat the ring of the previous step, we fill the position of a harmony randomly.
- The loop in this section is repeated as much as nVar. In each of these iterations, if the random value is equal to HCMR or smaller than that, a member of HM is randomly selected and the position of jM member of iM HM is placed in the jM position of the k member of the new array. If the random value is greater than HCMR, the answer is made randomly. In another condition, if the random value is equal to PAR or smaller than that, the answer is made randomly using FW values and applied to the jM position of the kth member of the new array.
- This section relates to the application of restrictions. If a position is withdrawn from VarMin or VarMax, we will return it to VarMin or VarMax.
- This step involves evaluating the answers from start to finish and sorting them and forming BestCost andBestSol.