Add a small cost for judge teams with no experience, try to avoid that.

This commit is contained in:
dave 2010-02-17 18:34:35 +00:00
parent d4782758aa
commit 573a580e3a

View File

@ -104,6 +104,7 @@ function judges_cost_function($annealer, $bucket_id, $ids)
$cost = 0;
$have_chair = false;
$have_div2 = false;
$years_experience = 0;
if($bucket_id == 0) {
/* This is the placeholder for all judges, there's a slight
@ -165,6 +166,10 @@ function judges_cost_function($annealer, $bucket_id, $ids)
/* If divisional round2 is enabled, make sure there is a judge
* on the team for round2 */
if($j['available_for_divisional2'] == true) $have_div2 = true;
/* Add up the years experience */
$years_experience += $j['years_school'] + $j['years_regional'] + $j['years_national'];
}
/* Huge penalty for a team without a willing chair, but only if the min judges per team >1 */
if(!$have_chair && $config['min_judges_per_team']>1)
@ -175,6 +180,11 @@ function judges_cost_function($annealer, $bucket_id, $ids)
if($have_div2 == false)
$cost += 40;
}
/* Small penalty for a jteam with no experience whatsoever */
if($years_experience == 0) {
$cost += 2;
}
// TRACE("Team $bucket_id, cost is $cost\n");