pymoo
pymoo copied to clipboard
Import Error with pymoo Factory Functions
I'm new to Pymoo and currently working with a code I found on GitHub. However, I'm encountering an error when trying to import the following packages:
from pymoo.factory import get_sampling, get_crossover, get_mutation, get_reference_directions, get_termination
Has anyone else experienced this issue, or does anyone know how to resolve it? Any help would be greatly appreciated!
Hey! the "factory" in Pymoo's new version does not exists anymore. Try to read the documentation: https://pymoo.org/operators/index.html
I had the same problem and it was solved with the comands:
from pymoo.operators.sampling.rnd import BinaryRandomSampling
from pymoo.operators.mutation.bitflip import BitflipMutation
from pymoo.operators.crossover.hux import HUX
Thank you
Yes the factory methods caused issues and were not intuitive to many users. So we have first deprecated them and removed them later.