def xover_selection(snakes, survivors, opts, num_survivors):
    """ Picks parents from the current generation of snakes for crossover
    params:
        snakes: list, current generation of snakes of class Snake
        survivors: list, snakes of class Snake that survived
        opts: dict, contains hyperparamters
        num_survivors: int, how many survivors there should be
    returns:
        list of parents of class Snake
    """
    parents = []
    max_num_parents = opts["PopulationSize"] - num_survivors
    while len(parents) < max_num_parents:
        for survivor in survivors:
            if (len(parents) < max_num_parents):
                parents.append(survivor)
        for snake in snakes:
            if snake not in survivors:
                if snake.selected:
                    if (len(parents) < max_num_parents):
                        parents.append(snake)
    return parents