public static Crossover getCrossoverOperator(String name, Dictionary <string, object> parameters)
        {
            // <pex>
            if (name == (string)null)
            {
                throw new ArgumentNullException("name");
            }
            if (parameters == (Dictionary <string, object>)null)
            {
                throw new ArgumentNullException("parameters");
            }
            // </pex>
            Crossover oper = null;

            if (name.ToUpper().Equals("SBXCrossover".ToUpper()))
            {
                oper = new SBXCrossover(parameters);
            }
            else if (name.ToUpper().Equals("DifferentialEvolutionCrossover".ToUpper()))
            {
                oper = new DifferentialEvolutionCrossover(parameters);
            }
            else
            {
                //System.Console.WriteLine ("Crossover object doesn't existtttttttttttttt");
                //throw new
            }
            return(oper);
        }
Пример #2
0
 public static Crossover getCrossoverOperator (String name, Dictionary<string, object> parameters)
 {
   // <pex>
   if (name == (string)null)
     throw new ArgumentNullException ("name");
   if (parameters == (Dictionary<string, object>)null)
     throw new ArgumentNullException ("parameters");
   // </pex>
   Crossover oper = null;
   if (name.ToUpper ().Equals ("SBXCrossover".ToUpper ())) {
     oper = new SBXCrossover (parameters);
   }
   else if (name.ToUpper ().Equals ("DifferentialEvolutionCrossover".ToUpper ())) {
     oper = new DifferentialEvolutionCrossover (parameters);
   }
   else {
     //System.Console.WriteLine ("Crossover object doesn't existtttttttttttttt");
     //throw new
   }
   return oper;
 }