Research Article
Mutation-Based Harmony Search Algorithm for Hybrid Testing of Web Service Composition
(1) | Set initialisation parameters: | (2) | HMS = Number of Harmony Memory Size; | (3) | HMCR = Harmony Memory Consideration Rate (HMCR); where, 0 ≤ HMCR ≤ 1; | (4) | PAR = Pitch Adjusting Rate (PAR); where 0 ≤ PAR ≤ 1; | (5) | = Number of New Harmony; | (6) | = Number of Iteration; | (7) | = Number of Task; | (8) | For ⟵ 1 to HMS do | (9) | = Random service on position; | (10) | = Calculate fitness value of by Equation (9); | (11) | End for | (12) | Best, Worst = Indexes for Best and Worst solutions in HM based on their fitness value; | (13) | Do | (14) | For i ⟵ 1 to do | (15) | = New Harmony position; | (16) | For j ⟵ 1 to do | (17) | If (rand(0,1) ≤ HMCR) then | (18) | ; | (19) | If rand(0,1) ≤ PAR then | (20) | Mutation Operator ⟵ Random (Swap, Insert, Reverse); | (21) | Mutation Operator; | (22) | End if | (23) | End if | (24) | End for | (25) | If ( < ) then | (26) | = ; | (27) | Update Worst, Best; | (28) | End if | (29) | End for | (30) | While ( ⟵ 1 to )//∗ The terminate criterion ∗// | (31) | Return = The best solution in the harmony memory; |
|