From 59bf4ead1de16e3fe4b3bf59e17b6bb77e054f90 Mon Sep 17 00:00:00 2001 From: Irina Hoppe Date: Tue, 19 Nov 2024 14:43:09 +0100 Subject: [PATCH] annotate new distribution algorithm --- classes/ratings_and_allocations_table.php | 15 --------------- classes/task/cron_task.php | 5 +---- locallib.php | 3 +++ solver/edmonds-karp.php | 2 -- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/classes/ratings_and_allocations_table.php b/classes/ratings_and_allocations_table.php index 591119f9..6817fd9c 100644 --- a/classes/ratings_and_allocations_table.php +++ b/classes/ratings_and_allocations_table.php @@ -899,14 +899,6 @@ public function init_sql() { $sortfields = $this->get_sort_columns(); - - // To do vardumps entfernen. - var_dump($sortfields); - var_dump("
sortdata: "); - var_dump($this->sortdata); - var_dump("
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) { @@ -929,13 +921,6 @@ public function init_sql() { } $sortfields = $this->get_sort_columns(); - var_dump("
sortdata nach preferences: "); - var_dump($this->sortdata); - var_dump("
sortcolumns nach preferences: "); - var_dump($this->get_sort_columns()); - var_dump("
sortorder nach preferences: "); - var_dump($this->get_sort_order()); - $fields = "u.*"; if ($userids) { diff --git a/classes/task/cron_task.php b/classes/task/cron_task.php index edd08b20..266d9b28 100644 --- a/classes/task/cron_task.php +++ b/classes/task/cron_task.php @@ -81,9 +81,6 @@ 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. @@ -91,7 +88,7 @@ public function execute() { // Run allocation. $ratingallocate->distrubute_choices(); } - */ + } return true; } diff --git a/locallib.php b/locallib.php index e0173501..d03083e7 100644 --- a/locallib.php +++ b/locallib.php @@ -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); diff --git a/solver/edmonds-karp.php b/solver/edmonds-karp.php index 9961b9c1..b3d1747c 100644 --- a/solver/edmonds-karp.php +++ b/solver/edmonds-karp.php @@ -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.