guofei9987 / guofei9987/scikit-opt
Complex constraints in PSO
Open
feature request
resolved
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I have tried running the example in PSO with the constraints (defined in DE example). However,
constraint_eq = [lambda x: 1 - x[1] - x[2]]
pso = PSO(func=obj_func, dim=2, pop=40, max_iter=100, lb=new_low_bound, ub=new_up_bound, constraint_eq=constraint_eq, w=0.8, c1=0.5, c2=0.5)
However, the is an error showing that TypeError: __init__() got an unexpected keyword argument 'constraint_eq'.
Could you please tell me how to add constraints in PSO?
Contributor guide
Assessment
This issue has not been assessed yet.