Whoa, guess this divs/cats adjustment never made it into branch! scheduler is complete b0rked without it.

This commit is contained in:
james 2011-02-16 20:28:55 +00:00
parent d58e8f4a1e
commit 0b57eb2edd

View File

@ -139,15 +139,18 @@ function judges_cost_function($annealer, $bucket_id, $ids)
for($y=0; $y < count($t['cats']); $y++) { for($y=0; $y < count($t['cats']); $y++) {
$l = $t['cats'][$y]; $l = $t['cats'][$y];
/* Lookup the judge cat pref for this category */ /* Lookup the judge cat pref for this category */
$pref = -$j['catprefs'][$l] + 2; $pref = -$j['cat_prefs'][$l] + 2;
/* $pref = 0 (best match) --- 4 (worst match) */ /* $pref = 0 (best match) --- 4 (worst match) */
//but wait, if they're "indifferent" then we really dont care, so the cost for it shoudl be 0.
if($pref==2) $pref=0;
$cpref += $pref; $cpref += $pref;
} }
$dpref = 0; $dpref = 0;
for($y=0; $y < count($t['divs']); $y++) { for($y=0; $y < count($t['divs']); $y++) {
$l = $t['divs'][$y]; $l = $t['divs'][$y];
/* Lookup the judge cat pref for this category */ /* Lookup the judge cat pref for this category */
$pref = -$j['divprefs'][$l] + 2; $pref = -$j['div_prefs'][$l] + 5;
/* $pref = 0 (best match) --- 4 (worst match) */ /* $pref = 0 (best match) --- 4 (worst match) */
$dpref += $pref; $dpref += $pref;
} }
@ -326,11 +329,22 @@ function pr_judge(&$jt, $jid)
print("("); print("(");
foreach($jt['cats'] as $c) foreach($jt['cats'] as $c)
print("c{$c}={$j['cat_prefs'][$c]} "); print("c{$c}={$j['cat_prefs'][$c]} ");
echo " / ";
foreach($j['cat_prefs'] AS $k=>$v) {
print("c{$k}=$v ");
}
echo ") (";
foreach($jt['divs'] as $d) foreach($jt['divs'] as $d)
print("d{$d}={$j['div_prefs'][$d]} "); print("d{$d}={$j['div_prefs'][$d]} ");
echo " / ";
foreach($j['div_prefs'] AS $k=>$v) {
print("d{$k}=$v ");
}
print(")"); print(")");
if($j['willing_chair'] == 'yes') print(" (chair) "); if($j['willing_chair'] == 'yes') print(" chair ");
print("\n"); print("\n");
} }