Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Summary of HSA

Thursday, December 14, 2023 4:58 PM

• Harmony Search Algorithm (HAS) is a metaheuristic optimizer


inspired by the music improvisation process.
• In the music improvisation process, a predefined number of
musicians attempt to tune the pitch of their instruments to achieve a
pleasing harmony (best state).
• The quality of the improvised harmony is determined by aesthetic
estimation.
• In general, when a musician wants to tune the pitch of an instrument
(for example fiddle, saxophone, etc.) and sound a note, musician
utilizes one of the three possible ways. These rules are the main
body of HSA.
a. To play the known.
b. To play something similar to the basic melody.
c. To start improvisation by selecting new note sequences that will form a
completely new music material.

Harmony Search Algorithm Page 1


Pseudocode of HSA
Thursday, December 14, 2023 5:04 PM

---------------------------------------------------------------------------------------
---------
for ( = 1; HMS; ++)
for ( = 1; ; ++)
Randomly initialize in HM;
end for
end for
Repeat
for ( = 1; ; ++)
if (rand(0, 1) < HMCR)
Let in x be the jth dimension of a randomly selected HM
member;

if (rand(0, 1) < PAR)


Apply pitch adjustment distance bw to mutate ;

end if
else
Let in x be a random value;

end if
end for
Evaluate the fitness of x: (x);
if ( (x) is better than the fitness of the worst HM member)
Replace the worst HM member with x;
else
Disregard x;
end if
Until a preset termination criterion is met;
---------------------------------------------------------------------------------------
---------

• The initial Harmony Memory (HM) consists of a certain number of


randomly generated solutions to the optimization problems under
consideration. For an -dimension problem, an HM with the size of

Harmony Search Algorithm Page 2


consideration. For an -dimension problem, an HM with the size of
can be represented as follows:

where ( = 1, 2, . . ., HMS) is a solution candidate.


HMS is typically set to be between 50 and 100.
• Harmony Memory Considering Rate (HMCR) is defined as the
probability of selecting a component from the HM members.
• The Pitching Adjust Rate (PAR) determines the probability of a
candidate from the HM to be mutated.

Harmony Search Algorithm Page 3

You might also like