コード例 #1
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);
        }
コード例 #2
0
ファイル: CrossoverFactory.cs プロジェクト: xiebinhqy/Optimo
 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;
 }