Handcoded Policy

Input: State s.
Output: Action a.

{
//If possible, shoot.
IF s.dist_to_goal(O1) < 15.0 AND s.max_ang_with_goal(O1) > 20.0 OR s.dist_to_goal(O1) < 25.0 AND s.max_ang_with_goal(O1) > 40.0
a <- Shoot;
RETURN;

//If possible, dribble.
IF s.min_dist_to_defender(O1) > 6.0 AND s.min_dist_to_defender_in_dribble_cone(01) > 10.0
a <- Dribble;
RETURN;

//Decide to whom to pass.
FOR i = 2, 3, 4
safe_to_pass_i <- TRUE;

IF s.dist(O1, Oi) > 30.0
safe_to_pass_i <- FALSE;

IF s.dist_to_goal(Oi) > 20.0
IF s.min_dist_to_defender < 6.0 OR s.min_ang_with_defender < 20.0

safe_to_pass_i <- FALSE;

IF s.dist_to_goal(Oi) <= 20.0
IF s.min_dist_to_defender < 4.0 OR s.min_ang_with_defender < 15.0

safe_to_pass_i <- FALSE;

IF safe_to_pass_i
pass_value_i <- -s.dist_to_goal(Oi);
ELSE
pass_value_i <- -infinity;

IF safe_to_pass_2 OR safe_to_pass_3 OR safe_to_pass_4 //It is safe to pass to someone.
i <- argmax_i {pass_value_i};
ELSE //It is not safe to pass, so just pass to one who has the widest angle with the defenders.
i <- argmax_i s.min_ang_with_defender(Oi);

a <- Passi;
RETURN;
}