public static void RunIntroOptimization() { var solutionSpace = new IntervalBranch(0, 3.2); var bb = new SIDBranchAndBound <double>(solutionSpace, FitnessFunctions.ExampleFunction, GuidingParameter.OneOverNthQuantile); var result = bb.BranchAndBound(200, 8, 0.99, false, false); Program.logger.WriteLine("Intro Optimization Results:"); for (int i = 0; i < result.Length; i++) { Program.logger.WriteLine($"{i}: {result[i].ToString()}"); } }
public static void RunWickedCombOptimization() { var solutionSpace = new IntervalBranch(-0.15, 0.15); // Constraints const double difficulty = 5; const double xSquaredCoefficient = 10; const int sampleSize = 200; const double confidenceLevel = 0.99; const int numSteps = 15; var bb = new SIDBranchAndBound <double>(solutionSpace, x => FitnessFunctions.WickedComb(x, difficulty, xSquaredCoefficient), GuidingParameter.OneOverNthQuantile); var result = bb.BranchAndBound(sampleSize, numSteps, confidenceLevel, false, false); Program.logger.WriteLine($"Wicked Comb (x, {difficulty}, {xSquaredCoefficient}) Size {sampleSize} Confidence {confidenceLevel} Optimization Results:"); for (int i = 0; i < result.Length; i++) { Program.logger.WriteLine($"{i}: {result[i].ToString()}"); } }