(self, genome)
The GPopulation Class creator
The GPopulation Class creator
The GPopulation Class creator
def __init__(self, genome):
      """ The GPopulation Class creator """

      if isinstance(genome, GPopulation):
         self.oneSelfGenome = genome.oneSelfGenome
         self.internalPop = []
         self.internalPopRaw = []
         self.popSize = genome.popSize
         self.sortType = genome.sortType
         self.sorted = False
         self.minimax = genome.minimax
         self.scaleMethod = genome.scaleMethod
         self.allSlots = [self.scaleMethod]

         self.internalParams = genome.internalParams
         self.multiProcessing = genome.multiProcessing

         self.statted = False
         self.stats = Statistics()
         return

      logging.debug("New population instance, %s class genomes.", genome.__class__.__name__)
      self.oneSelfGenome = genome
      self.internalPop = []
      self.internalPopRaw = []
      self.popSize = 0
      self.sortType = Consts.CDefPopSortType
      self.sorted = False
      self.minimax = Consts.CDefPopMinimax
      self.scaleMethod = FunctionSlot("Scale Method")
      self.scaleMethod.set(Consts.CDefPopScale)
      self.allSlots = [self.scaleMethod]

      self.internalParams = {}
      self.multiProcessing = (False, False, None)

      # Statistics
      self.statted = False
      self.stats = Statistics()
def __init__ ( self , genome ) : if isinstance ( genome , GPopulation ) : self . oneSelfGenome = genome . oneSelfGenome self . internalPop = [ ] self . internalPopRaw = [ ] self . popSize = genome . popSize self . sortType = genome . sortType self . sorted = False self . minimax = genome . minimax self . scaleMethod = genome . scaleMethod self . allSlots = [ self . scaleMethod ] self . internalParams = genome . internalParams self . multiProcessing = genome . multiProcessing self . statted = False self . stats = Statistics ( ) return logging . debug ( "New population instance, %s class genomes." , genome . __class__ . __name__ ) self . oneSelfGenome = genome self . internalPop = [ ] self . internalPopRaw = [ ] self . popSize = 0 self . sortType = Consts . CDefPopSortType self . sorted = False self . minimax = Consts . CDefPopMinimax self . scaleMethod = FunctionSlot ( "Scale Method" ) self . scaleMethod . set ( Consts . CDefPopScale ) self . allSlots = [ self . scaleMethod ] self . internalParams = { } self . multiProcessing = ( False , False , None ) # Statistics self . statted = False self . stats = Statistics ( )