Closed JenEy-git closed 3 years ago
I am pinging @mlooz on this as he originally wrote the scipy wrapper.
I am a bit confused, because this looks like a multiobjective problem, but I thought the scipy algorithms solve only single-objective problems?
It is not multi-objective, but has a constraint. I think that since the new individual with fitness [-5.67577, 7.33971e-17] technically violates the constraint (by 7.33971e-17), it is not regarded as a feasible solution to be the new champion.
What happens if you set the constraint tolerance c_tol of the problem to something bigger, i.e. 1e-16?
Hello, Increasing constraint tolerance solves the problem ! This is linked to the ordering of the population for a constrained problem Thank your for your answer. Julien
Sent with ProtonMail Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ Le mercredi 2 juin 2021 à 00:30, Moritz v. Looz @.***> a écrit :
It is not multi-objective, but has a constraint. I think that since the new individual with fitness [-5.67577, 7.33971e-17] technically violates the constraint (by 7.33971e-17), it is not regarded as a feasible solution to be the new champion.
What happens if you set the constraint tolerance c_tol of the problem to something bigger, i.e. 1e-16?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Hello, I'm trying to use pygmo to optimize the position of some plants in a Garden. The fitness function is non linear, and I have also a non-linear equality constraint. I used the local solver of scipy "trust-constr". the problem I have is that the value of the champion does not seem to be updated after the evolution.
Printing the population before and after evoution, the individual is converging to the minimum. But the champion is not updated. What could be the problem? (See below for the prints)
The code I use is very simple: gd_pos = Pl.PlantPosition(inter_mat, lh_garden, pos_plant_fixed, radii_non_overlap, radii_inter) # user defined problem prob = pg.problem(gd_pos) algo = pg.algorithm(pg.scipy_optimize(method="trust-constr")) pop = pg.population(prob, size=1) print(pop) pop = algo.evolve(pop) print(pop)
PRINT BEFORE EVOLUTION: "Problem name: Plant Positioning C++ class name: pybind11::object
Extra info:
Number of plants: 3
[XY] size of the garden: [1 1]
Matrix interaction: [[0 1 1] [1 0 1] [1 1 0]]
Radii vector: [0.1 0.1 0.1]
Population size: 1
List of individuals:
0:
Champion decision vector: [0.411191, 0.620839, 0.740699, 0.543479, 0.922681, ... ] Champion fitness: [-3.37961, 0] "
PRINT AFTER THE EVOLUTION: "Problem name: Plant Positioning C++ class name: pybind11::object
Extra info:
Number of plants: 3
[XY] size of the garden: [1 1]
Matrix interaction: [[0 1 1] [1 0 1] [1 1 0]]
Radii vector: [0.1 0.1 0.1]
Population size: 1
List of individuals:
0:
Champion decision vector: [0.411191, 0.620839, 0.740699, 0.543479, 0.922681, ... ] Champion fitness: [-3.37961, 0] "