Skip to content

Commit

Permalink
annotate new distribution algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
irinahpe committed Nov 19, 2024
1 parent 9ce7214 commit 59bf4ea
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
15 changes: 0 additions & 15 deletions classes/ratings_and_allocations_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -899,14 +899,6 @@ public function init_sql() {

$sortfields = $this->get_sort_columns();


// To do vardumps entfernen.
var_dump($sortfields);
var_dump("</br> sortdata: ");
var_dump($this->sortdata);
var_dump("</br> sortorder: ");
var_dump($this->get_sort_order());

// If we have teamvote enabled, always order by team first, in order to always show users in their teams.
if ($this->showteams) {

Expand All @@ -929,13 +921,6 @@ public function init_sql() {
}
$sortfields = $this->get_sort_columns();

var_dump("</br> sortdata nach preferences: ");
var_dump($this->sortdata);
var_dump("</br> sortcolumns nach preferences: ");
var_dump($this->get_sort_columns());
var_dump("</br> sortorder nach preferences: ");
var_dump($this->get_sort_order());


$fields = "u.*";
if ($userids) {
Expand Down
5 changes: 1 addition & 4 deletions classes/task/cron_task.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,14 @@ public function execute() {
$ratingallocate->distrubute_choices();


// To do wieder alte funktion...
// Only start the algorithm, if it should be run by the cron and hasn't been started somehow, yet.
/*
if ($ratingallocate->ratingallocate->runalgorithmbycron === "1" &&
$ratingallocate->get_algorithm_status() === \mod_ratingallocate\algorithm_status::NOTSTARTED) {
// Clear eventually scheduled distribution of unallocated users.
$ratingallocate->clear_distribute_unallocated_tasks();
// Run allocation.
$ratingallocate->distrubute_choices();
}
*/

}
return true;
}
Expand Down
3 changes: 3 additions & 0 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,9 @@ public function distrubute_choices() {
$this->origdbrecord->algorithmstarttime = time();
$this->db->update_record(this_db\ratingallocate::TABLE, $this->origdbrecord);


// Since edmonds-karp algrothm is always used, we did not implement a teamvote-distribution algorithm.
// For ford-fulkerson-koegel. Keep this in mind if the distributor is changed in the future.
$distributor = new solver_edmonds_karp();
$timestart = microtime(true);
$distributor->distribute_users($this);
Expand Down
2 changes: 0 additions & 2 deletions solver/edmonds-karp.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ private function find_shortest_path_bellf_cspf2 ($from, $to, $teamvote, $toteami
}




/**
* Find the shortest path with constraint (enough space for all teammembers in choice).
* This is a modified version of the Yen Algorithm for the constrained shortest path first problem.
Expand Down

0 comments on commit 59bf4ea

Please sign in to comment.