original_docstring: 
          Function to make new population of crossover-ed and mutated solutions (offsprings) from given population.
  
          Parameters:
  
              population (list) - list of parent solutions.
              size (int) - the population size set for the GA run.
              mutationProbability (float) - the probability of mutating an edge.
              swapProbability (float) - the probability of doing a swap on a mutating edge.
              transferProbability (float) - the probability of doing a transfer on a mutating edge.
              k (int) - the value of 'k' in case of K-Point crossover. (Used only for experiments)
  
          Returns:
  
              newSolutions (list) - list of children solutions (offsprings)
          
docstring: Function to make new population of crossover-ed and mutated solutions (offsprings) from given population.
  Parameters.
  
  population (list) - list of parent solutions.
  size (int) - the population size set for the GA run.
  mutationProbability (float) - the probability of mutating an edge.
  swapProbability (float) - the probability of doing a swap on a mutating edge.
  transferProbability (float) - the probability of doing a transfer on a mutating edge.
  k (int) - the value of 'k' in case of K-Point crossover. (Used only for experiments)
  
  
  
  newSolutions (list) - list of children solutions (offsprings)
docstring_tokens: Function to make new population of crossover - ed and mutated solutions ( offsprings ) from given population . Parameters . population ( list ) - list of parent solutions . size ( int ) - the population size set for the GA run . mutationProbability ( float ) - the probability of mutating an edge . swapProbability ( float ) - the probability of doing a swap on a mutating edge . transferProbability ( float ) - the probability of doing a transfer on a mutating edge . k ( int ) - the value of ' k ' in case of K - Point crossover . ( Used only for experiments ) newSolutions ( list ) - list of children solutions ( offsprings )
code: def makeNewPopulation(self,population,size,mutationProbability,swapProbability,transferProbability,k=None):
          """
          Function to make new population of crossover-ed and mutated solutions (offsprings) from given population.
  
          Parameters:
  
              population (list) - list of parent solutions.
              size (int) - the population size set for the GA run.
              mutationProbability (float) - the probability of mutating an edge.
              swapProbability (float) - the probability of doing a swap on a mutating edge.
              transferProbability (float) - the probability of doing a transfer on a mutating edge.
              k (int) - the value of 'k' in case of K-Point crossover. (Used only for experiments)
  
          Returns:
  
              newSolutions (list) - list of children solutions (offsprings)
          """
          
          newPopulation = [] #offspring population
  
          #Get the mutated solutions
          
          mutatedSolutions = self.mutation(population,mutationProbability,swapProbability,transferProbability) if self._mutation_flag else []
  
          #Select parents for crossover using selection operator
          
          crossoverPop = self._selection(population,size)
  
          #crossover the selected parents
          
          crossoverSolutions = self.crossover(crossoverPop,k) if self._crossover_flag else []
  
  
          #combine both mutated and crossover-ed solution to create an offspring population
          
          newPopulation.extend(mutatedSolutions)
          newPopulation.extend(crossoverSolutions)
          
          return newPopulation
code_tokens: def makeNewPopulation ( self , population , size , mutationProbability , swapProbability , transferProbability , k = None ) : newPopulation = [ ] mutatedSolutions = self . mutation ( population , mutationProbability , swapProbability , transferProbability ) if self . _mutation_flag else [ ] crossoverPop = self . _selection ( population , size ) crossoverSolutions = self . crossover ( crossoverPop , k ) if self . _crossover_flag else [ ] newPopulation . extend ( mutatedSolutions ) newPopulation . extend ( crossoverSolutions ) return newPopulation
short_docstring: Function to make new population of crossover-ed and mutated solutions (offsprings) from given population.
short_docstring_tokens: Function to make new population of crossover - ed and mutated solutions ( offsprings ) from given population .
comment: """
          Function to make new population of crossover-ed and mutated solutions (offsprings) from given population.
  
          Parameters:
  
              population (list) - list of parent solutions.
              size (int) - the population size set for the GA run.
              mutationProbability (float) - the probability of mutating an edge.
              swapProbability (float) - the probability of doing a swap on a mutating edge.
              transferProbability (float) - the probability of doing a transfer on a mutating edge.
              k (int) - the value of 'k' in case of K-Point crossover. (Used only for experiments)
  
          Returns:
  
              newSolutions (list) - list of children solutions (offsprings)
          """$SEP$#offspring population$SEP$#Get the mutated solutions$SEP$#Select parents for crossover using selection operator$SEP$#crossover the selected parents$SEP$#combine both mutated and crossover-ed solution to create an offspring population