Description:
        Generate a Mixture of 2 Plackett-Luce models
        dataset and save it to disk.
    Parameters:
        n:            number of votes to generate
        m:            number of alternatives
        outfile:      open file object to which the dataset is written
        useDirichlet: boolean flag to use the Dirichlet distribution

def _generate_mix2pl_dataset(n, m, outfile, useDirichlet=True):
    """
    Description:
        Generate a Mixture of 2 Plackett-Luce models
        dataset and save it to disk.
    Parameters:
        n:            number of votes to generate
        m:            number of alternatives
        outfile:      open file object to which the dataset is written
        useDirichlet: boolean flag to use the Dirichlet distribution
    """
    params, votes = generate_mix2pl_dataset(n, m, useDirichlet)
    outfile.write(str(m) + ',' + str(n) + '\n')
    outfile.write(','.join(map(str, params)) + '\n')
    for vote in votes:
        outfile.write(','.join(map(str, vote)) + '\n')
    return (params, votes)