- Timestamp:
- 11/26/15 17:36:54 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/EsGriewankSampleTest.cs
r12012 r13408 62 62 SingleObjectiveTestFunctionProblem problem = new SingleObjectiveTestFunctionProblem(); 63 63 64 problem.ProblemSize .Value= 10;65 problem. EvaluatorParameter.Value = new GriewankEvaluator();64 problem.ProblemSize = 10; 65 problem.TestFunction = new Griewank(); 66 66 problem.SolutionCreatorParameter.Value = new UniformRandomRealVectorCreator(); 67 problem.Maximization.Value = false;68 67 problem.Bounds = new DoubleMatrix(new double[,] { { -600, 600 } }); 69 problem.BestKnownQuality .Value= 0;68 problem.BestKnownQuality = 0; 70 69 problem.BestKnownSolutionParameter.Value = new RealVector(10); 71 70 problem.Name = "Single Objective Test Function"; -
branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/LocalSearchKnapsackSampleTest.cs
r12012 r13408 59 59 #region Problem Configuration 60 60 KnapsackProblem problem = new KnapsackProblem(); 61 problem.BestKnownQuality = new DoubleValue(362);61 problem.BestKnownQuality = 362; 62 62 problem.BestKnownSolution = new HeuristicLab.Encodings.BinaryVectorEncoding.BinaryVector(new bool[] { 63 63 true , false, false, true , true , true , true , true , false, true , true , true , true , true , true , false, true , false, true , true , false, true , true , false, true , false, true , true , true , false, true , true , false, true , true , false, true , false, true , true , true , true , true , true , true , true , true , true , true , true , true , false, true , false, false, true , true , false, true , true , true , true , true , true , true , true , false, true , false, true , true , true , true , false, true , true , true , true , true , true , true , true}); 64 problem.EvaluatorParameter.Value = new KnapsackEvaluator();65 64 problem.SolutionCreatorParameter.Value = new RandomBinaryVectorCreator(); 66 problem.KnapsackCapacity.Value = 297; 67 problem.Maximization.Value = true; 68 problem.Penalty.Value = 1; 65 problem.KnapsackCapacity = 297; 69 66 problem.Values = new IntArray(new int[] { 70 67 6, 1, 1, 6, 7, 8, 7, 4, 2, 5, 2, 6, 7, 8, 7, 1, 7, 1, 9, 4, 2, 6, 5, 3, 5, 3, 3, 6, 5, 2, 4, 9, 4, 5, 7, 1, 4, 3, 5, 5, 8, 3, 6, 7, 3, 9, 7, 7, 5, 5, 7, 1, 4, 4, 3, 9, 5, 1, 6, 2, 2, 6, 1, 6, 5, 4, 4, 7, 1, 8, 9, 9, 7, 4, 3, 8, 7, 5, 7, 4, 4, 5}); -
branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/OSESGriewankSampleTest.cs
r13237 r13408 21 21 22 22 using System.IO; 23 using HeuristicLab.Algorithms.EvolutionStrategy;24 23 using HeuristicLab.Algorithms.OffspringSelectionEvolutionStrategy; 25 24 using HeuristicLab.Data; … … 63 62 SingleObjectiveTestFunctionProblem problem = new SingleObjectiveTestFunctionProblem(); 64 63 65 problem.ProblemSize .Value= 10;66 problem. EvaluatorParameter.Value = new GriewankEvaluator();64 problem.ProblemSize = 10; 65 problem.TestFunction = new Griewank(); 67 66 problem.SolutionCreatorParameter.Value = new UniformRandomRealVectorCreator(); 68 problem.Maximization.Value = false;69 67 problem.Bounds = new DoubleMatrix(new double[,] { { -600, 600 } }); 70 problem.BestKnownQuality .Value= 0;68 problem.BestKnownQuality = 0; 71 69 problem.BestKnownSolutionParameter.Value = new RealVector(10); 72 70 problem.Name = "Single Objective Test Function"; -
branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/PsoSchwefelSampleTest.cs
r12012 r13408 68 68 #region Problem Configuration 69 69 var problem = new SingleObjectiveTestFunctionProblem(); 70 problem.BestKnownQuality .Value= 0.0;70 problem.BestKnownQuality = 0.0; 71 71 problem.BestKnownSolutionParameter.Value = new RealVector(new double[] { 420.968746, 420.968746 }); 72 72 problem.Bounds = new DoubleMatrix(new double[,] { { -500, 500 } }); 73 problem.EvaluatorParameter.Value = new SchwefelEvaluator(); 74 problem.Maximization.Value = false; 75 problem.ProblemSize.Value = 2; 73 problem.TestFunction = new Schwefel(); 74 problem.ProblemSize = 2; 76 75 problem.SolutionCreatorParameter.Value = new UniformRandomRealVectorCreator(); 77 76 #endregion -
branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/SimulatedAnnealingRastriginSampleTest.cs
r12012 r13408 57 57 #region Problem Configuration 58 58 var problem = new SingleObjectiveTestFunctionProblem(); 59 problem.BestKnownQuality .Value= 0.0;59 problem.BestKnownQuality = 0.0; 60 60 problem.BestKnownSolutionParameter.Value = new RealVector(new double[] { 0, 0 }); 61 61 problem.Bounds = new DoubleMatrix(new double[,] { { -5.12, 5.12 } }); 62 problem.EvaluatorParameter.Value = new RastriginEvaluator(); 63 problem.Maximization.Value = false; 64 problem.ProblemSize.Value = 2; 62 problem.TestFunction= new Rastrigin(); 63 problem.ProblemSize = 2; 65 64 problem.SolutionCreatorParameter.Value = new UniformRandomRealVectorCreator(); 66 65 #endregion … … 79 78 sa.MaximumIterations.Value = 100; 80 79 var moveEvaluator = sa.MoveEvaluatorParameter.ValidValues 81 .OfType< RastriginAdditiveMoveEvaluator>()80 .OfType<AdditiveMoveEvaluator>() 82 81 .Single(); 83 moveEvaluator.A.Value = 10;84 82 sa.MoveEvaluator = moveEvaluator; 85 83
Note: See TracChangeset
for help on using the changeset viewer.