/**
  * @depends testMontarSumario
  */
 public function testScenarioComRegrasMaxvmSub()
 {
     $placements = array(array('A:2', 'A:3'), array('B:1', 'B:2'), array('C:2', 'C:3'), array('D:1', 'D:2', 'D:3'));
     $scenario = Scenario::buildScenarioByPlacements($placements);
     $resp = Approximation::calcularComRegrasMaxVMSub($scenario, 3);
     $this->assertEquals(23, $resp);
 }
Exemple #2
0
} elseif (isset($_GET['file']) && file_exists('others/' . $_GET['file'])) {
    $scenario = array_pop(json_decode(file('others/' . $_GET['file'])[0], true));
} else {
    $scenarios = Scenario::geraScenarios($apr, array($nvm), array($npm));
    $scenario = array_pop($scenarios);
}
$json = Scenario::toDataTableJSON($scenario);
//$memcache = memcache_connect('localhost', 11211);
//$accordion = isset($_GET['cache']) ? false : memcache_get($memcache, 'accordion');
//$accordion = false;
//if ($accordion == false) {
//echo "<script>alert('Not Cached');</script>";
$accordion = new Accordion();
$sem = Approximation::calcularSemRegras($scenario);
$com = Approximation::calcularComRegras($scenario);
$last = Approximation::calcularComRegrasMaxVMSub($scenario, $max);
$tree = Approximation::treeSearchApproach($scenario, $max);
$test1 = 0;
//Approximation::calcularComRegrasMaxVMOutIn($scenario, $max);
$test_c_a = 0;
//Approximation::calculateAvgCombSplitterApproach($scenario, $max);
$test_c_s = 0;
//Approximation::calculateSumCombSplitterApproach($scenario, $max);
$test_s_p = 0;
//Approximation::calculateProdSequencialSplitterApproach($scenario, $max);
$test_s_s = 0;
//Approximation::calculateSumSequencialSplitterApproach($scenario, $max);
//$filtered = Combinations::GenerateAllCombinationsMaxVM($scenario['placements'], $max);
$real = 0;
//count($filtered);
$title = sprintf($fmt_accordion_title, $max, $scenario['nvms'], $scenario['npms'], $sem, $com, $real, $tree, $last, $test1, $test_c_a, $test_c_s, $test_s_p, $test_s_s);