def load_random_chromosome(chr_name):
 cur_chromosome = BasicChromosome.Chromosome(chr_name)
 num_segments = random.randrange(num_possible_segments)
 for seg in range(num_segments):
  if (seg == 0):
   cur_segment = BasicChromosome.TelomereSegment()
  elif (seg == (num_segments - 1)):
   cur_segment = BasicChromosome.TelomereSegment(1)
  else:
   cur_segment = BasicChromosome.ChromosomeSegment()
  color_chance = random.random()
  if (color_chance <= color_prob):
   fill_color = random.choice(color_choices)
   cur_segment.fill_color = fill_color
  id_chance = random.random()
  if (id_chance <= id_prob):
   id = get_random_id()
   cur_segment.label = id
  cur_chromosome.add(cur_segment)
 return (cur_chromosome, num_segments)

def load_random_chromosome ( chr_name ) : cur_chromosome = BasicChromosome . Chromosome ( chr_name ) num_segments = random . randrange ( num_possible_segments ) for seg in range ( num_segments ) : if ( seg == 0 ) : cur_segment = BasicChromosome . TelomereSegment ( ) elif ( seg == ( num_segments - 1 ) ) : cur_segment = BasicChromosome . TelomereSegment ( 1 ) else : cur_segment = BasicChromosome . ChromosomeSegment ( ) color_chance = random . random ( ) if ( color_chance <= color_prob ) : fill_color = random . choice ( color_choices ) cur_segment . fill_color = fill_color id_chance = random . random ( ) if ( id_chance <= id_prob ) : id = get_random_id ( ) cur_segment . label = id cur_chromosome . add ( cur_segment ) return ( cur_chromosome , num_segments )
generate a chromosome with random information about it .