diff --git a/admin/tours_sa.php b/admin/tours_sa.php index 994ebe7..cb77b35 100644 --- a/admin/tours_sa.php +++ b/admin/tours_sa.php @@ -69,8 +69,15 @@ set_percent(0); - Foreach student in a tour +15 - Above the grade level +25 - Below the grade level - - + +5 - Noone from the same school + If ranked (rank=1,2,3,4,...): + +(rank*rank*5 - 5) = +0, +15, +40, +75 + If not ranked: + +(max_choices*max_choices*5) (always greater than ranked) + - Foreach tour + +100 for each student above the capacity + +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 */ @@ -95,7 +102,11 @@ function tour_cost_function($annealer, $bucket_id, $ids) /* Compute the over max / under min costs */ $c = count($ids); $over = ($c > $t['capacity']) ? $c - $t['capacity'] : 0; - $under = ($c < ($t['capacity']/4)) ? ($t['capacity']/4) - $c : 0; + if($c > 0) + $under = ($c < ($t['capacity']/4)) ? ($t['capacity']/4) - $c : 0; + else + $under = 0; + $cost += $over * 100; $cost += $under * 200;