/*******************************************************************************
 * GenRGenS v.1.0, Generation of Random Genomic Sequences                      *
 * Copyright (C) 2001  Alain Denise/Yann Ponty                                 *
 *                                                                             *
 * This program is free software; you can redistribute it and/or               *
 * modify it under the terms of the GNU General Public License                 *
 * as published by the Free Software Foundation; either version 2              *
 * of the License, or (at your option) any later version.                      *
 *                                                                             *
 * This program is distributed in the hope that it will be useful,             *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of              *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
 * GNU General Public License for more details.                                *
 *                                                                             *
 * You should have received a copy of the GNU General Public License           *
 * along with this program; if not, write to the Free Software                 *
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. *
 *******************************************************************************/

package GenRGenS.markov;

import GenRGenS.*;
import GenRGenS.IU.*;
import GenRGenS.utility.*;
import GenRGenS.utility.holder.*;

public class MarkovianGenerationConfiguration implements GeneratorConfigFile
{
		/**
		 * Variable determinant la tolérance ou non d'impasses dans les fichiers markoviens
		 * false => Tolérance aux impasses(taille des séquences générées <= taille souhaitée)
		 * true => Pas de tolérance ?la présence d'impasse(taille des séquences générées = taille souhaitée)
		 * Par défaut, le soft tolère les impasses dans les fichiers markoviens, quitte ?
		 * générer des mots de tailles inférieures ?celle souhaitée.
		 */
  public static boolean ExactSizeMarkovianGeneration = false;

		/**
		 * La chaîne de caractère permettant d'exiger du compilateur la
		 * non tolérance d'impasse dans les fichiers de description markoviens.
		 */

  private static final String exactMarkovOptionString = "-m";



  public Class getGeneratorClass()
  {
    Class gen = null;
    try
    {
      gen = Class.forName("GenRGenS.markov.Markov");
    }
    catch (ClassNotFoundException e)
    {GenRGenS.err.println("Couldn't find class GenRGenS.markov.Markov.");}
    return gen;
  }

  public Option[] getOptions()
  {
    Option[] options = new Option[1];
    options[0] = new Option(new BooleanHolder()
        {
          public void set(boolean i)
          {
            MarkovianGenerationConfiguration.ExactSizeMarkovianGeneration = i;
          }
          public boolean get()
          {
            return MarkovianGenerationConfiguration.ExactSizeMarkovianGeneration;
          }
        },
        "Exact size generation",
        exactMarkovOptionString,
        "F : Do not crash when \"deadends\" are found, returning a word smaller than expected(default).\nT : Checks each markovian description file for \"Dead-Ends\" patterns to occur.",
        "Some description files may contain \"Dead-Ends\", which would prevent " +
        "the markovian generation algorithm to provide as much symbols as " +
        "expected.\nShould we scan the markovian frequencies to look for such " +
        "\"Dead-Ends\"?");
    return options;
  }

  public String getDescriptionFileHeader()
  { return "MARKOV"; }

  public String getLitteralName()
  { return "Markovian Generation"; }

}