예제 #1
0
 public SA_Queens startSolver(ParametersOfSolver parameter)
 {
     Console.WriteLine("------Start Solver :" + parameter.numberQueens);
     queens = new SA_Queens(parameter.numberQueens);
     parameter.generateNewSolution = queens.generateRandomState(parameter.numberQueens);
     return(queens);
 }
예제 #2
0
 public SimulatedAnnealing(ParametersOfSolver parameter, SA_Queens queensUtil)
 {
     this.QueensUtil                      = queensUtil;
     parameterSA                          = new ParametersOfSA();
     parameterSA.numberQueens             = parameter.numberQueens;
     parameterSA.coolingFactor            = parameter.coolingFactor;
     parameterSA.stabilizingFactor        = parameter.stabilizingFactor;
     parameterSA.freezingTemperature      = parameter.freezingTemperature;
     parameterSA.generateNewSolution      = parameter.generateNewSolution;
     parameterSA.generateNeighbor         = parameter.generateNeighbor;
     parameterSA.acceptNeighbor           = parameter.acceptNeighbor;
     parameterSA.currentSystemEnergy      = QueensUtil.generateRandomState(parameterSA.numberQueens);
     parameterSA.currentSystemTemperature = parameter.initialTemperature;
     parameterSA.currentStabilizer        = parameter.initialstabilizer;
 }