pymoo icon indicating copy to clipboard operation
pymoo copied to clipboard

Import Error with pymoo Factory Functions

Open Paeyus opened this issue 1 year ago • 2 comments

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!

Paeyus avatar Oct 15 '24 05:10 Paeyus

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

lldl42 avatar Oct 16 '24 17:10 lldl42

Thank you

Paeyus avatar Oct 17 '24 07:10 Paeyus

Yes the factory methods caused issues and were not intuitive to many users. So we have first deprecated them and removed them later.

blankjul avatar Nov 05 '24 08:11 blankjul