forked from science-ation/science-ation
- Fix most issues with projects being judged multiple times. This should fix
all issues EXCEPT that the timetable scheduler may assign two judging teams to the same project at the same time. I will fix that soon. But everything else should now work.
This commit is contained in:
parent
c79f16837b
commit
b86bb3bc9a
@ -193,7 +193,14 @@ function jdiv_compute_cost($annealer, $bucket_id, $ids)
|
||||
/* Score 25pts for multiple divs/cats */
|
||||
$cost += (count($t_div) - 1) * 25;
|
||||
$cost += (count($t_cat) - 1) * 25;
|
||||
|
||||
|
||||
/* Score +200 pts for each duplicate project this team is judging, we
|
||||
* really don't want a jteam judging the same project twice */
|
||||
for($x=0; $x<count($ids) - 1; $x++) {
|
||||
for($y=$x+1; $y<count($ids); $y++) {
|
||||
if($ids[$x] == $ids[$y]) $cost += 200;
|
||||
}
|
||||
}
|
||||
return $cost;
|
||||
}
|
||||
|
||||
@ -288,12 +295,16 @@ $jteam[$jteam_id]['langs'] = array();
|
||||
$jteam[$jteam_id]['min_judges'] = 0;
|
||||
$jteam[$jteam_id]['max_judges'] = 0;
|
||||
$jteam_id++;
|
||||
|
||||
TRACE("Assigning projects to judging teams...\n");
|
||||
$keys = array_keys($jdiv);
|
||||
for($k=0; $k<count($keys); $k++) {
|
||||
$jdiv_id = $keys[$k];
|
||||
TRACE("Judging Division $jdiv_id ({$jdiv[$jdiv_id]['num_jteams']} teams): \n");
|
||||
$project_ids = array_keys($jdiv[$jdiv_id]['projects']);
|
||||
$jdiv_id = $keys[$k];
|
||||
TRACE("Judging Division $jdiv_id ({$jdiv[$jdiv_id]['num_jteams']} teams): \n");
|
||||
$project_ids = array();
|
||||
for($x=0; $x<$data['times_judged']; $x++) {
|
||||
$project_ids = array_merge($project_ids, array_keys($jdiv[$jdiv_id]['projects']) );
|
||||
}
|
||||
$current_jdiv = $jdiv[$jdiv_id];
|
||||
|
||||
$e = 100 + 10 * ($data['effort'] / 1000);
|
||||
@ -570,7 +581,8 @@ while($r=mysql_fetch_object($q)) {
|
||||
$available_timeslots[$x]['endtime']."\n");
|
||||
$x++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TRACE("Assigning Judging Teams and Projects to Timeslots...\n");
|
||||
for($x=1;$x<count($jteam); $x++) {
|
||||
$pids = $jteam[$x]['projects'];
|
||||
|
Loading…
Reference in New Issue
Block a user