cbx.utils.particle_init.init_particles#

class cbx.utils.particle_init.init_particles(shape=(1, 1, 1), x_min=-1.0, x_max=1.0, delta=1.0, method='uniform')[source]#

Bases:

Initialize particles

Parameters:
  • N (int, optional) – Number of particles. The default is 100.

  • d (int, optional) – Dimension of the particles. The default is 2.

  • x_min (float, optional) – Lower bound for the uniform distribution. The default is 0.0.

  • x_max (float, optional) – Upper bound for the uniform distribution. The default is 1.0.

  • delta (float, optional) – Standard deviation for the normal distribution. The default is 1.0.

  • method (str, optional) – Method for initializing the particles. The default is “uniform”. Possible values: “uniform”, “normal”

Returns:

x – Array of particles of shape (N, d)

Return type:

numpy.ndarray