diff --git a/admin/tours.php b/admin/tours.php index d13ab1b..25a5da9 100644 --- a/admin/tours.php +++ b/admin/tours.php @@ -33,7 +33,7 @@ echo "".i18n("Manage Tours")." ".i18n("- Add, Delete, Edit, and List tours")."
"; echo "".i18n("Edit Student-Tour Assignments")."
"; echo "
"; - echo "".i18n("Automatic Tour Assignments")."
"; + echo "".i18n("Automatic Tour Assignments")."
"; send_footer(); diff --git a/admin/tours_sa.php b/admin/tours_sa.php index cb77b35..10632d6 100644 --- a/admin/tours_sa.php +++ b/admin/tours_sa.php @@ -44,9 +44,8 @@ TRACE("
");
 function set_status($txt)
 {
 	TRACE("Status: $txt\n");
-	return;
 	mysql_query("UPDATE config SET val='$txt' WHERE 
-			var='tours_scheduler_activity' AND year=0");
+			var='tours_assigner_activity' AND year=0");
 }
 
 $set_percent_last_percent = -1;
@@ -57,9 +56,8 @@ function set_percent($n)
 	if($p == $set_percent_last_percent) return;
 	TRACE("Progress: $p\%\n");
 	$set_percent_last_percent = $p;
-	return;
 	mysql_query("UPDATE config SET val='$p' WHERE 
-			var='tours_scheduler_percent' AND year=0");
+			var='tours_assigner_percent' AND year=0");
 }
 
 set_status("Initializing...");
@@ -79,9 +77,6 @@ set_percent(0);
 		+200 for each student below 1/4 the capacity,but
 			zero if the tour is empty
 */
-
-/* Compute the cost of adding a judge to a team */
-
 function tour_cost_function($annealer, $bucket_id, $ids)
 {
 	global $config;
@@ -89,7 +84,7 @@ function tour_cost_function($annealer, $bucket_id, $ids)
 	global $tours;
 	global $students;
 	/* Bucket ID is the tour number */
-	/* ids are the judge ids currently in the bucket */
+	/* ids are the student ids currently in the bucket */
 
 //	TRACE("Bucket id=$bucket_id, ids=");
 //	TRACE_R($ids);
@@ -207,9 +202,9 @@ function tours_assignment_update($progress, $total)
 	set_percent(($progress * 50) / $total);
 }
 
-TRACE("Effort: {$config['effort']}\n");
+TRACE("Effort: {$config['tours_assigner_effort']}\n");
 set_status("Assigning students to tours");
-$e = 100 + 10 * ($config['effort'] / 100);
+$e = 100 + 10 * ($config['tours_assigner_effort'] / 100);
 $a = new annealer(count($tours), 50, $e, 0.98,
 		tour_cost_function, $student_ids);
 $a->set_update_callback(tours_assignment_update);
diff --git a/admin/tours_sa_status.php b/admin/tours_sa_status.php
new file mode 100644
index 0000000..9b27e27
--- /dev/null
+++ b/admin/tours_sa_status.php
@@ -0,0 +1,155 @@
+
+   Copyright (C) 2005 James Grant 
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation, version 2.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this pr\n";
+ogram; see the file COPYING.  If not, write to
+   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+*/
+?>
+val;
+
+	$q=mysql_query("SELECT val FROM config WHERE year='0' AND var='tours_assigner_activity'");
+	$r=mysql_fetch_object($q);
+	$status=$r->val;
+
+	echo "$percent:$status\n";
+	exit;
+ }
+
+ require("../common.inc.php");
+ send_header("Scheduler Status",
+ 		array('Committee Main' => 'committee_main.php',
+			'Administration' => 'admin/index.php',
+			'Tours' => 'admin/tours.php')
+				);
+ require_once("../ajax.inc.php");
+?>
+
+
+
+";
+	echo "
"; + echo "".i18n("Automatic Tour Assignment Configuration").""; + +} +else +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
".i18n("Assignment status").":
".i18n("Assignment percent").":
".i18n("Assignment ETA").":
"; + + echo "
"; + echo i18n("When the assignments are complete, the following links will be useful:"); + echo "
"; +?> + + diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 76a8b2b..871727d 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -83 +84 diff --git a/db/db.update.84.sql b/db/db.update.84.sql new file mode 100644 index 0000000..6c41bb1 --- /dev/null +++ b/db/db.update.84.sql @@ -0,0 +1,6 @@ +INSERT INTO `config` ( `var` , `val` , `category` , `type` , `type_values` , `ord` , `description` , `year`) + VALUES + ( 'tours_assigner_activity', 'Done', 'Tour Assigner', '', '', '99999', '', '0'), + ( 'tours_assigner_percent', '-1', 'Tour Assigner', '', '', '99999', '', '0'), + ( 'tours_assigner_effort', '10000', 'Tour Assigner', '', '', '99999', 'This number controls how long and hard the tour assigner will look for a quality solution. Smaller numbers are lower effort. 100 is practically no effort, 1000 is moderate effort, 10000 is high effort. It can take several tens of minutes to run the assigner with high effort, but it gives a very good solution.', '-1'); +