def _pso(self, n_particles, n_iterations, optimizer):

        """
        :param n_particles: number of PSO particles
        :param n_iterations: number of PSO iterations
        :param optimizer: instance of SinglePlaneOptimizer or MultiPlaneOptimizer
        :return: optimized kwargs_lens
        """

        pso = ParticleSwarmOptimizer(optimizer, low=self._lower_limit, high=self._upper_limit, particleCount=n_particles)

        gBests = pso._optimize(maxIter=n_iterations,standard_dev=self._pso_convergence_standardDEV)

        likelihoods = [particle.fitness for particle in gBests]
        ind = np.argmax(likelihoods)

        return gBests[ind].position
def _pso ( self , n_particles , n_iterations , optimizer ) : pso = ParticleSwarmOptimizer ( optimizer , low = self . _lower_limit , high = self . _upper_limit , particleCount = n_particles ) gBests = pso . _optimize ( maxIter = n_iterations , standard_dev = self . _pso_convergence_standardDEV ) likelihoods = [ particle . fitness for particle in gBests ] ind = np . argmax ( likelihoods ) return gBests [ ind ] . position
:param n_particles: number of PSO particles
        :param n_iterations: number of PSO iterations
        :param optimizer: instance of SinglePlaneOptimizer or MultiPlaneOptimizer
        :return: optimized kwargs_lens