Beispiel #1
0
function main()
{
    global $nodes, $streams;
    // this are global to PDQ_Lib
    $k = 0;
    // Warning!! k is a global name in the PDQ_Lib!!!!
    $name = "";
    $nstr = "";
    /* input parameters */
    $think = 10.0;
    $users = 300;
    // 800;
    $Sifp = 0.1;
    $Samp = 0.6;
    $Sdsu = 1.2;
    $Nifp = 15;
    $Namp = 50;
    $Ndsu = 100;
    // PDQ_SetDebug(TRUE);
    PDQ_Init("Teradata DBC-10/12");
    /* Create parallel centers */
    for ($k = 0; $k < $Nifp; $k++) {
        itoa($k, $nstr);
        $name = "IFP" . $nstr;
        $nodes = PDQ_CreateNode($name, CEN, FCFS);
    }
    for ($k = 0; $k < $Namp; $k++) {
        itoa($k, $nstr);
        $name = "AMP" . $nstr;
        $nodes = PDQ_CreateNode($name, CEN, FCFS);
    }
    for ($k = 0; $k < $Ndsu; $k++) {
        itoa($k, $nstr);
        $name = "DSU" . $nstr;
        $nodes = PDQ_CreateNode($name, CEN, FCFS);
    }
    $streams = PDQ_CreateClosed("query", TERM, (double) $users, $think);
    /*PDQ_SetGraph("query", 100); - unsupported call */
    for ($k = 0; $k < $Nifp; $k++) {
        itoa($k, $nstr);
        $name = "IFP" . $nstr;
        PDQ_SetDemand($name, "query", $Sifp / $Nifp);
    }
    for ($k = 0; $k < $Namp; $k++) {
        itoa($k, $nstr);
        $name = "AMP" . $nstr;
        PDQ_SetDemand($name, "query", $Samp / $Namp);
    }
    for ($k = 0; $k < $Ndsu; $k++) {
        itoa($k, $nstr);
        $name = "DSU" . $nstr;
        PDQ_SetDemand($name, "query", $Sdsu / $Ndsu);
    }
    /* 300 nodes takes about a minute to solve on a PowerMac */
    printf("Solving ... ");
    PDQ_Solve(APPROX);
    printf("Done.\n");
    /* PDQ_PrintXLS(); */
    PDQ_Report();
}
Beispiel #2
0
        $course = new Course();
        do {
            $rnd = generateRandomString(5);
        } while (Course::where('u_identifier', '=', $rnd)->first() != NULL);
        $course->u_identifier = $rnd;
        $course->name = $course_installer->name;
        $course->description = $course_installer->description;
        $course->maxStudentsPerStripe = $course_installer->maxStudentsPerStripe;
        $course->single_stripe = $course_installer->single_stripe;
        $course->referents = $course_installer->referents;
        $course->save();
        for ($c = 0; $c < 9; $c++) {
            if (intval($course_installer->{itoa($c + 1)}) != 0) {
                $stripe = new Stripe();
                $stripe->stripe_number = $c + 1;
                $stripe->stripe_call = $course_installer->{itoa($c + 1)};
                $course->stripes()->save($stripe);
            }
        }
    }
    return redirect(route("admin"))->withSuccess("Corsi importati con successo.");
}]);
// ------
// Authentication routes
Route::get('/', ['as' => 'auth.getLogin', 'uses' => 'Auth\\AuthController@getLogin']);
Route::post('auth/login', ['as' => 'auth.postLogin', 'uses' => 'Auth\\AuthController@postLogin']);
Route::get('auth/logout', ['as' => 'auth.logout', 'uses' => 'Auth\\AuthController@getLogout']);
// Registration routes
Route::get('auth/register', ['as' => 'auth.getRegister', 'uses' => 'Auth\\AuthController@getRegister']);
Route::post('auth/register', 'Auth\\AuthController@postRegister');
// SIGNUP - QUIT