Reference: Kaiping Luo, Jie Ma, Qiuhong Zhao. Enhanced self-adaptive global-best harmony search without any extra statistic and external archive. Information Sciences, 2019. 482: 228-247.
Variables | Meaning |
---|---|
hms | Harmony memory size |
ni | The number of improvisations (iterations) |
hmcr | Harmony memory consideration rate |
par | Pitch adjustment rate |
bw | Bandwidth |
lb | The lower bound (list) |
ub | The upper bound (list) |
pos | The set of harmonies (list) |
score | The score of harmonies (list) |
dim | Dimension |
gbest | The score of the global best harmony |
gbest_pos | The position of the global best harmony (list) |
iter_best | The global best score of each iteration (list) |
con_iter | The last iteration number when "gbest" is updated |
if __name__ == '__main__':
# Parameter settings
hms = 10
lb = [0, 0, 10, 10]
ub = [99, 99, 200, 200]
ni = 10000 * len(lb)
print(main(hms, ni, lb, ub))
The ESGHS converges at its 14,294-th iteration, and the global best value is 8050.914044830637.
{
'best score': 8050.914044830637,
'best solution': [1.3005502310626382, 0.6428626530744853, 67.38602233485172, 10.000000182456352],
'convergence iteration': 14294
}