AttributeError: module 'pygmo' has no attribute 'spea2'

232 Views Asked by At

Pygmo 2.1 haven't SPEA2 Algorithm implemented yet?

I'm asking because SPEA2 looks fully implemented on Pygmo documentation

nsga2 algorithm it's ok.

Steps to reproduce error:

import pygmo as pg <br/>
algo = pg.algorithm(pg.spea2(archive_size = 0))

I expect get no errors, but i am getting

AttributeError: module 'pygmo' has no attribute 'spea2'
1

There are 1 best solutions below

2
On

I'm looking at the example documentation, I think this could work:

from PyGMO import *
alg = algorithm.spea2(archive_size = 0)

You're trying to access spea2 from the base module whereas it is a part of the algorithms sub-module.