@Test(enabled = TestConstants.EnabledTest) public void testPresenceSolutionBlind() { log.info("=== TEST for SOLUTION GENERATION of BLIND optimizer STARTED ==="); optimizer = new Optimizer(TestConstants.NUM_PLANS_TO_GENERATE, SearchMethodName.BLINDSEARCH); String[] arrayDam = optimizer.optimize(appModel, suitableCloudOffer); for (int damnum = 0; damnum < arrayDam.length; damnum++) { try { checkCorrectness(arrayDam[damnum]); } catch (Exception e) { log.error("There was an error in the check of correctness. Solution was: " + arrayDam[damnum]); throw e; } saveFile(TestConstants.OUTPUT_FILENAME + SearchMethodName.BLINDSEARCH + damnum + ".yaml", arrayDam[damnum]); } log.info("=== TEST for SOLUTION GENERATION of BLIND optimizer FINISEHD ==="); }
public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; }
Optimizer { public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; } }
Optimizer { public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; } Optimizer();  Optimizer(int num);  Optimizer(SearchMethodName name);  Optimizer(int num, SearchMethodName name);  Optimizer(int num, SearchMethodName name, double hysteresis); }
Optimizer { public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; } Optimizer();  Optimizer(int num);  Optimizer(SearchMethodName name);  Optimizer(int num, SearchMethodName name);  Optimizer(int num, SearchMethodName name, double hysteresis); String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms); String[] optimize(String appModel, String suitableCloudOffer); }
Optimizer { public String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms) { String[] outputPlans = new String[NUMBER_OF_PLANS_GENERATED]; outputPlans[0] = "Plan generation was not possible"; if (previousPlans == null) { OptimizerInitialDeployment initialOptimizer = new OptimizerInitialDeployment(searchName); try { outputPlans = initialOptimizer.optimize(appModel, MMtoOptModelTransformer.transformModel(suitableCloudOffer), benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Exception exc) { log.warn( "Optimizer did not work in its expected input. Exception name was " + exc.getClass().getName() +" Trying with the assumption of former versions of Input "); outputPlans = initialOptimizer.optimize(appModel, suitableCloudOffer, benchmarkPlatforms, NUMBER_OF_PLANS_GENERATED,HYSTERESIS_PROPORTION); previousPlans = outputPlans; } catch (Error E) { log.error("Error optimizing the initial deployment"); E.printStackTrace(); } } else { } return outputPlans; } Optimizer();  Optimizer(int num);  Optimizer(SearchMethodName name);  Optimizer(int num, SearchMethodName name);  Optimizer(int num, SearchMethodName name, double hysteresis); String[] optimize(String appModel, String suitableCloudOffer, String benchmarkPlatforms); String[] optimize(String appModel, String suitableCloudOffer);  }