def create_neigh_bee(site, patch_size, problem): p = site.position[:] i = randint(0, len(p) - 1) j = randint(i, len(p)) temp = p[i:j] p = np.concatenate([p[:i], p[j:]]) r = randint(0, len(p)) p = np.insert(p, r, temp) temp = Bee(problem, p) schedule = temp.schedule_builder(list(p)) temp.schedule = schedule return temp