// Path: src/generator/errors/FragmentErrorGenerator.java
// public abstract class FragmentErrorGenerator
// {
// 	/**
// 	 * Used to determine which character to randomly insert/switch
// 	 */
// 	protected final Random characterChoiceRandomizer;
// 	/**
// 	 * Intended for use by each generator to determine whether to introduce an
// 	 * error (e.g. substitute a character, start an indel)
// 	 */
// 	protected final Random random;
// 	protected final String allowedCharacters;
// 	protected boolean verbose;
// 
// 	public FragmentErrorGenerator(String allowedCharacters_)
// 	{
// 		allowedCharacters = allowedCharacters_;
// 		characterChoiceRandomizer = new Random();
// 		random = new Random();
// 	}
// 
// 	public abstract CharSequence generateErrors(CharSequence sequence);
// 
// 	public Fragment generateErrors(Fragment fragment)
// 	{
// 		String s = fragment.toString();
// 		Fragment errored = new Fragment(generateErrors(s).toString());
// 		errored.clonePositionsAndReadQuality(fragment);
// 		for (int i = 0; i < errored.getSequence().length(); i++)
// 		{
// 			errored.setReadQuality(i, getQuality(i, errored.getSequence().length()));
// 		}
// 		return errored;
// 	}
// 
// 	public List<? extends Fragment> generateErrors(List<? extends Fragment> fragments)
// 	{
// 		List<Fragment> list = new ArrayList<Fragment>(fragments.size());
// 		for (Fragment fragment : fragments)
// 		{
// 			list.add(generateErrors(fragment));
// 		}
// 		return list;
// 	}
// 
// 	/**
// 	 * @deprecated You should probably use
// 	 *             {@link Fragmentizer#fragmentizeToFile(CharSequence, generator.Fragmentizer.Options, File)}
// 	 *             and set the {@link Fragmentizer.Options#errorGenerators}
// 	 *             field appropriately instead of using this.
// 	 * @param errorGenerators
// 	 * @param fragmentList
// 	 * @param fragmentFile
// 	 */
// 	@Deprecated
// 	public static void generateErrorsToFile(List<FragmentErrorGenerator> errorGenerators,
// 		List<? extends Fragment> fragmentList, File fragmentFile)
// 	{
// 		try
// 		{
// 			FastqWriter w = new FastqWriter(new FileWriter(fragmentFile));
// 			for (int i = 0; i < fragmentList.size(); i++)
// 			{
// 				Fragment f = fragmentList.get(i);
// 				for (FragmentErrorGenerator eg : errorGenerators)
// 				{
// 					f = eg.generateErrors(f);
// 				}
// 				w.writeFragment(f, 0, i);
// 			}
// 			w.close();
// 		}
// 		catch (IOException e)
// 		{
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public abstract int getQuality(int position, int length);
// 
// 	public static int phredScaleProbability(double errorProbability)
// 	{
// 		return (int) (-10 * Math.log10(errorProbability));
// 	}
// 
// 	public void setVerboseOutput(boolean verbose_)
// 	{
// 		verbose = verbose_;
// 	}
// }
// 
// Path: src/generator/errors/UniformErrorGenerator.java
// public class UniformErrorGenerator extends SubstitutionErrorGenerator
// {
// 	private double errorProbability;
// 
// 	public UniformErrorGenerator(String allowedCharacters_, double errorProbability_)
// 	{
// 		super(allowedCharacters_);
// 		setErrorProbability(errorProbability_);
// 	}
// 
// 	@Override
// 	protected double getSubstitutionProbability(int position, int length)
// 	{
// 		return errorProbability;
// 	}
// 
// 	public void setErrorProbability(double errorProbability_)
// 	{
// 		if (errorProbability_ <= 1.0 && errorProbability_ >= 0.0)
// 		{
// 			errorProbability = errorProbability_;
// 		}
// 		else
// 		{
// 			// TODO: be nicer about this :)
// 			throw new IllegalArgumentException("error probability must be >= 0.0 and <= 1.0");
// 		}
// 	}
// 
// 	public double getErrorProbability()
// 	{
// 		return errorProbability;
// 	}
// 
// 	/**
// 	 * Don't need to use the nice {@link #getErrorProbability} method,
// 	 * since we know that it's the same for every character position in this
// 	 * class.
// 	 */
// 	@Override
// 	public CharSequence generateErrors(CharSequence sequence)
// 	{
// 		if (verbose)
// 		{
// 			System.err.println();
// 			System.err.printf("Original sequence: %s%n", sequence);
// 			System.err.print("                   ");
// 		}
// 		StringBuilder sb = new StringBuilder(sequence.length());
// 		StringBuilder errorIndicator = new StringBuilder(sequence.length());
// 		for (int i = 0; i < sequence.length(); i++)
// 		{
// 			char orig = sequence.charAt(i);
// 			if (random.nextDouble() < getSubstitutionProbability(i, sequence.length()))
// 			{
// 				sb.append(chooseRandomReplacementCharacter(orig));
// 				if (verbose)
// 				{
// 					errorIndicator.append("X");
// 				}
// 			}
// 			else
// 			{
// 				sb.append(orig);
// 				if (verbose)
// 				{
// 					errorIndicator.append(" ");
// 				}
// 			}
// 		}
// 		if (verbose)
// 		{
// 			System.err.println(errorIndicator.toString());
// 			System.err.printf("New sequence:      %s%n%n", sb.toString());
// 		}
// 		return sb;
// 	}
// }


import generator.errors.FragmentErrorGenerator;
import generator.errors.UniformErrorGenerator;
import java.util.Arrays;
import java.util.Random;
package generator;


public class SeqGenSingleSequenceMultipleRepeats extends SequenceGenerator
{
	Random random = new Random();

	@Override
	public CharSequence generateSequence(Options o)
	{
// Path: src/generator/errors/FragmentErrorGenerator.java
// public abstract class FragmentErrorGenerator
// {
// 	/**
// 	 * Used to determine which character to randomly insert/switch
// 	 */
// 	protected final Random characterChoiceRandomizer;
// 	/**
// 	 * Intended for use by each generator to determine whether to introduce an
// 	 * error (e.g. substitute a character, start an indel)
// 	 */
// 	protected final Random random;
// 	protected final String allowedCharacters;
// 	protected boolean verbose;
// 
// 	public FragmentErrorGenerator(String allowedCharacters_)
// 	{
// 		allowedCharacters = allowedCharacters_;
// 		characterChoiceRandomizer = new Random();
// 		random = new Random();
// 	}
// 
// 	public abstract CharSequence generateErrors(CharSequence sequence);
// 
// 	public Fragment generateErrors(Fragment fragment)
// 	{
// 		String s = fragment.toString();
// 		Fragment errored = new Fragment(generateErrors(s).toString());
// 		errored.clonePositionsAndReadQuality(fragment);
// 		for (int i = 0; i < errored.getSequence().length(); i++)
// 		{
// 			errored.setReadQuality(i, getQuality(i, errored.getSequence().length()));
// 		}
// 		return errored;
// 	}
// 
// 	public List<? extends Fragment> generateErrors(List<? extends Fragment> fragments)
// 	{
// 		List<Fragment> list = new ArrayList<Fragment>(fragments.size());
// 		for (Fragment fragment : fragments)
// 		{
// 			list.add(generateErrors(fragment));
// 		}
// 		return list;
// 	}
// 
// 	/**
// 	 * @deprecated You should probably use
// 	 *             {@link Fragmentizer#fragmentizeToFile(CharSequence, generator.Fragmentizer.Options, File)}
// 	 *             and set the {@link Fragmentizer.Options#errorGenerators}
// 	 *             field appropriately instead of using this.
// 	 * @param errorGenerators
// 	 * @param fragmentList
// 	 * @param fragmentFile
// 	 */
// 	@Deprecated
// 	public static void generateErrorsToFile(List<FragmentErrorGenerator> errorGenerators,
// 		List<? extends Fragment> fragmentList, File fragmentFile)
// 	{
// 		try
// 		{
// 			FastqWriter w = new FastqWriter(new FileWriter(fragmentFile));
// 			for (int i = 0; i < fragmentList.size(); i++)
// 			{
// 				Fragment f = fragmentList.get(i);
// 				for (FragmentErrorGenerator eg : errorGenerators)
// 				{
// 					f = eg.generateErrors(f);
// 				}
// 				w.writeFragment(f, 0, i);
// 			}
// 			w.close();
// 		}
// 		catch (IOException e)
// 		{
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	public abstract int getQuality(int position, int length);
// 
// 	public static int phredScaleProbability(double errorProbability)
// 	{
// 		return (int) (-10 * Math.log10(errorProbability));
// 	}
// 
// 	public void setVerboseOutput(boolean verbose_)
// 	{
// 		verbose = verbose_;
// 	}
// }
// 
// Path: src/generator/errors/UniformErrorGenerator.java
// public class UniformErrorGenerator extends SubstitutionErrorGenerator
// {
// 	private double errorProbability;
// 
// 	public UniformErrorGenerator(String allowedCharacters_, double errorProbability_)
// 	{
// 		super(allowedCharacters_);
// 		setErrorProbability(errorProbability_);
// 	}
// 
// 	@Override
// 	protected double getSubstitutionProbability(int position, int length)
// 	{
// 		return errorProbability;
// 	}
// 
// 	public void setErrorProbability(double errorProbability_)
// 	{
// 		if (errorProbability_ <= 1.0 && errorProbability_ >= 0.0)
// 		{
// 			errorProbability = errorProbability_;
// 		}
// 		else
// 		{
// 			// TODO: be nicer about this :)
// 			throw new IllegalArgumentException("error probability must be >= 0.0 and <= 1.0");
// 		}
// 	}
// 
// 	public double getErrorProbability()
// 	{
// 		return errorProbability;
// 	}
// 
// 	/**
// 	 * Don't need to use the nice {@link #getErrorProbability} method,
// 	 * since we know that it's the same for every character position in this
// 	 * class.
// 	 */
// 	@Override
// 	public CharSequence generateErrors(CharSequence sequence)
// 	{
// 		if (verbose)
// 		{
// 			System.err.println();
// 			System.err.printf("Original sequence: %s%n", sequence);
// 			System.err.print("                   ");
// 		}
// 		StringBuilder sb = new StringBuilder(sequence.length());
// 		StringBuilder errorIndicator = new StringBuilder(sequence.length());
// 		for (int i = 0; i < sequence.length(); i++)
// 		{
// 			char orig = sequence.charAt(i);
// 			if (random.nextDouble() < getSubstitutionProbability(i, sequence.length()))
// 			{
// 				sb.append(chooseRandomReplacementCharacter(orig));
// 				if (verbose)
// 				{
// 					errorIndicator.append("X");
// 				}
// 			}
// 			else
// 			{
// 				sb.append(orig);
// 				if (verbose)
// 				{
// 					errorIndicator.append(" ");
// 				}
// 			}
// 		}
// 		if (verbose)
// 		{
// 			System.err.println(errorIndicator.toString());
// 			System.err.printf("New sequence:      %s%n%n", sb.toString());
// 		}
// 		return sb;
// 	}
// }


// Path: src/generator/SeqGenSingleSequenceMultipleRepeats.java
import generator.errors.FragmentErrorGenerator;
import generator.errors.UniformErrorGenerator;
import java.util.Arrays;
import java.util.Random;

package generator;


public class SeqGenSingleSequenceMultipleRepeats extends SequenceGenerator
{
	Random random = new Random();

	@Override
	public CharSequence generateSequence(Options o)
	{
		FragmentErrorGenerator eg = new UniformErrorGenerator(o.characters,