mardi 27 décembre 2022

Levy Flights Cuckoo Search algorithm Python

I am implementing a cuckoo search algorithm for the TSP. However i am struggling with the part of levy flights in the implementation to create ranges. The levy flight should be between 0 and 1. See picture below for more explanation. Is there anyone who could help me out with the python implementation?

Currently i have the following code:

def levyFlight(u): return u/math.pow(1-u, 1.6)

def randF(): return uniform(0.0001, 0.9999)

levy = levyFlight(randF())

enter image description here




Aucun commentaire:

Enregistrer un commentaire