예제 #1
0
파일: QAPTester.cs 프로젝트: jswk/GA-BO
        // results in "qap/results/testName"
        public void test(string testName)
        {
            QAPProblem problem = problemFromFile(testName);

            //configuration
            GlobalConfiguration globalConfig = new GlobalConfiguration()
            {
                maximize = false
            };

            globalConfig.configurations = new List <IslandConfiguration>();
            globalConfig.configurations.Add(new IslandConfiguration(algorithm.enums.EvolutionStrategy.Tournament, 0.01, 0.1, 20, 10, 1));
            globalConfig.configurations.Add(new IslandConfiguration(algorithm.enums.EvolutionStrategy.Tournament, 0.02, 0.05, 30, 10, 1));
            globalConfig.configurations.Add(new IslandConfiguration(algorithm.enums.EvolutionStrategy.Tournament, 0.05, 0.02, 20, 10, 1));
            globalConfig.configurations.Add(new IslandConfiguration(algorithm.enums.EvolutionStrategy.Tournament, 0.1, 0.01, 30, 10, 1));
            globalConfig.connections = new List <int> [globalConfig.configurations.Count];
            for (int i = 0; i < globalConfig.configurations.Count; i++)
            {
                globalConfig.connections[i] = new List <int>();
            }
            //globalConfig.connections[0].Add(3);
            //globalConfig.connections[1].Add(3);
            //globalConfig.connections[2].Add(3);
            globalConfig.evolutionTimeInSeconds = 25;
            globalConfig.generator = new QAPGenerator(problem);

            IslandSupervisor supervisor = new IslandSupervisor(globalConfig);
            QAPIndividual    result     = (QAPIndividual)supervisor.getResult();

            foreach (int i in result.permutation)
            {
                Console.WriteLine(i.ToString() + " ");
            }
            //int result = 5;
            saveResult(result.value(), testName);
        }
예제 #2
0
파일: QAPGenerator.cs 프로젝트: jswk/GA-BO
 public QAPGenerator(QAPProblem problem)
 {
     this.problem = problem;
 }
예제 #3
0
 public QAPGenerator(QAPProblem problem)
 {
     this.problem = problem;
 }
예제 #4
0
파일: QAPIndividual.cs 프로젝트: jswk/GA-BO
 public QAPIndividual(QAPProblem problem, int[] value)
 {
     this.problem = problem;
     permutation = value;
 }
예제 #5
0
 public QAPIndividual(QAPProblem problem, int[] value)
 {
     this.problem = problem;
     permutation  = value;
 }