DEAP / deap

Distributed Evolutionary Algorithms in Python
http://deap.readthedocs.org/
GNU Lesser General Public License v3.0
5.75k stars 1.12k forks source link

Dominates function might be incorrect #510

Open pjuangph opened 3 years ago

pjuangph commented 3 years ago

https://github.com/DEAP/deap/blob/460d102550a2822aaa3a2f4eede4d4ee2780fd43/deap/base.py#L220

This is my dominate function. x and y are numpy arrays of the wvalues/fitnesses of each individual. I tried using your method and it didn't give me the pareto front for Kurasawe function. Everything else with my code and yours matches.

def dominates(x:np.ndarray,y:np.ndarray) -> bool:
        '''
            Returns true if all or any the objectives of x are less than y
        '''
        b = np.all(x <= y) & np.any(x<y)
        return b
fmder commented 3 years ago

Could you include a usecase where it fails? In the road to 2.0 I do have the same numpy dominates.