polarcbo.utils.init_particles
- class polarcbo.utils.init_particles(num_particles=100, d=2, x_min=0.0, x_max=1.0, delta=1.0, method='uniform')[source]
Bases:
Initialize particles
- Parameters:
num_particles (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 (num_particles, d)
- Return type:
numpy.ndarray