ljvmiranda921 / pyswarms

A research toolkit for particle swarm optimization in Python
https://pyswarms.readthedocs.io/en/latest/
MIT License
1.27k stars 333 forks source link

How to define a constrained bounds? #498

Open heliolei opened 2 years ago

heliolei commented 2 years ago

Dear all,

My bounds is like this:

current_bounds = (np.array([70.e6, 15., 10.e6,    10.e6]),\
                              np.array([80.e6, 25., 100.e6,  100.e6]))

However, in my optimization problem,

X[:][2] < X[:][3]

should always be constrained within the current bounds for all the particles

How can I realise this in our pyswarms code.

Tnank you in advance

Regrads,

Lei CAI