You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instructions to migrate between Oxigen major versions
Migrate from Oxigen 1.x to 2.x
Instead of implementing FromIterator<T> in your Genotype<T> struct, write a from_iter<I: Iterator<Item = T>>(&mut self, genes: I) function in the Genotype trait implementation that set the genes collecting the iterator:
// In 1.x versionsimplFromIterator<u8>forQueensBoard{fnfrom_iter<I>(iter:I) -> SelfwhereI:IntoIterator<Item = u8>,{QueensBoard{0: iter.into_iter().collect(),}}}// In 2.x versionsimplGenotype<u8>forQueensBoard{// [...]fnfrom_iter<I:Iterator<Item = u8>>(&mutself,genes:I){self.0 = genes.collect();}// [...]}
Return a boolean in the fix function specifying if the individual has been changed.