(genome, **args)
return (sister, brother)
The crossover of G2DList, Single Horizontal Point
The crossover of G2DList, Single Horizontal Point
The crossover of G2DList Single Horizontal Point
def G2DListCrossoverSingleHPoint(genome, **args):
   """ The crossover of G2DList, Single Horizontal Point """
   sister = None
   brother = None
   gMom = args["mom"]
   gDad = args["dad"]

   cut = rand_randint(1, gMom.getHeight() - 1)

   if args["count"] >= 1:
      sister = gMom.clone()
      sister.resetStats()
      for i in xrange(cut, sister.getHeight()):
         sister[i][:] = gDad[i][:]

   if args["count"] == 2:
      brother = gDad.clone()
      brother.resetStats()
      for i in xrange(brother.getHeight()):
         brother[i][:] = gMom[i][:]

   return (sister, brother)
def G2DListCrossoverSingleHPoint ( genome , * * args ) : sister = None brother = None gMom = args [ "mom" ] gDad = args [ "dad" ] cut = rand_randint ( 1 , gMom . getHeight ( ) - 1 ) if args [ "count" ] >= 1 : sister = gMom . clone ( ) sister . resetStats ( ) for i in xrange ( cut , sister . getHeight ( ) ) : sister [ i ] [ : ] = gDad [ i ] [ : ] if args [ "count" ] == 2 : brother = gDad . clone ( ) brother . resetStats ( ) for i in xrange ( brother . getHeight ( ) ) : brother [ i ] [ : ] = gMom [ i ] [ : ] return ( sister , brother )