Previously the PMXCrossover.execute function was returning a child solution with variables field referring to parts of parents' variables. It is due to variables being a list of lists, so the slice operator in _swap function was just copying the references of the lists in the list.
It resulted in unexpected behaviours like child mutation affecting its parents, which led to e.g. wrong solutions being reported as best.
Previously the
PMXCrossover.execute
function was returning a child solution withvariables
field referring to parts of parents'variables
. It is due tovariables
being a list of lists, so the slice operator in_swap
function was just copying the references of the lists in the list.It resulted in unexpected behaviours like child mutation affecting its parents, which led to e.g. wrong solutions being reported as best.