コード例 #1
0
 public function testScenarioSemRegras()
 {
     $scenario['nvms'] = 10;
     $scenario['npms'] = 10;
     $resp = Approximation::calcularSemRegras($scenario);
     $this->assertEquals($resp, pow(10, 10), "Numero de VMs esta errado.");
 }
コード例 #2
0
ファイル: index.php プロジェクト: arthurd2/placements
if (isset($_GET['state'])) {
    $scenario = Scenario::getScenarioFromJSON($_GET['state']);
} 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;