Start
Set N, HMS, D, P, par,
For i = 1 to N
   
End
   
End
t = 0
While t ≤ T
For i = 1 to D
  If rand ≤ P
   
   If
    
   End
  Else
  End
End
If
End
Update as formulae (7) and (8)
End while
Output
Algorithm 5: Pseudocode of IHS.