Esempio n. 1
0
        //creates NSGA-II Algorithm using Lower Limits, Upper Limits and numObjectives
        private static Algorithm CreateAlgorithm(double numObjectives, List <int> lowerLimits, List <int> upperLimits)
        {
            String algorithmName = "NSGAII";
            String problemName   = "myTest";

            int NumParam = lowerLimits.Count;
            int numObj   = Convert.ToInt32(numObjectives);

            int[] upperLim = upperLimits.ToArray <int>();
            int[] lowerLim = lowerLimits.ToArray <int>();

            Object          settingsParams = problemName;
            SettingsFactory sf             = new SettingsFactory();
            Settings        sets           = sf.getSettingsObject(algorithmName, problemName, NumParam, lowerLim, upperLim, numObj);

            Algorithm algorithm = sets.configure();

            return(algorithm);
        }
Esempio n. 2
0
        //creates NSGA-II Algorithm using Lower Limits, Upper Limits and numObjectives
        //private static Algorithm CreateAlgorithm (double numObjectives, List<int> lowerLimits, List<int> upperLimits)
        private static Algorithm CreateAlgorithm(double numObjectives, List<double> lowerLimits, List<double> upperLimits)
        {
            String algorithmName = "NSGAII";
            String problemName = "myTest";

            int NumParam = lowerLimits.Count;
            int numObj = Convert.ToInt32(numObjectives);

            //trying to change the upper and lower limits to double
            double[] upperLim = upperLimits.ToArray<double>();
            double[] lowerLim = lowerLimits.ToArray<double>();


            //int[] upperLim = upperLimits.ToArray<int>();
            //int[] lowerLim = lowerLimits.ToArray<int>();

            Object settingsParams = problemName;
            SettingsFactory sf = new SettingsFactory();
            Settings sets = sf.getSettingsObject(algorithmName, problemName, NumParam, lowerLim, upperLim, numObj);

            Algorithm algorithm = sets.configure();
            return algorithm;
        }