# Option estimate_blocking

Estimate the penalty when direction to ball is blocked by obstacles, e.g. opponent players, penalty is increased whenever an obstacle is detected and decreased when there is no obstacle.

## State not_blocked

If that state is active,
>  This decimal output symbol is set:
strategy.blocking_penalty  =
 0

The decision tree:

Pseudo code of the decision tree:

 /** */
if (
 ( obstacle.distance_in_direction() < 2000 )
&&
 ( obstacle.distance_in_direction() < (ball.distance() - 100) )
)
 {

 goto blocked;
 }
 else
 {

 /** */
if (
 ( obstacle.obstacle_distance.left() < 200 )
||
 ( obstacle.obstacle_distance.middle() < 200 )
||
 ( obstacle.obstacle_distance.right() < 200 )
)
 {

 /** */
 if ( strategy.blocking_penalty >= 5000 )
 {

 goto blocked;
 }
 else
 {

 goto increase_block;
 }
 }
 else
 {

 /** */
 if ( true )
 {

 /** */
 if ( strategy.blocking_penalty < 0 )
 {

 goto not_blocked;
 }
 else
 {

 goto decrease_block;
 }
 }
 else
 {

 stay;
 }
 }
 }

## State decrease_block

If that state is active,
>  This decimal output symbol is set:
strategy.blocking_penalty  =
 (strategy.blocking_penalty - 200)

The decision tree:

Pseudo code of the decision tree:

 /** */
if (
 ( obstacle.distance_in_direction() < 2000 )
&&
 ( obstacle.distance_in_direction() < (ball.distance() - 100) )
)
 {

 goto blocked;
 }
 else
 {

 /** */
if (
 ( obstacle.obstacle_distance.left() < 200 )
||
 ( obstacle.obstacle_distance.middle() < 200 )
||
 ( obstacle.obstacle_distance.right() < 200 )
)
 {

 /** */
 if ( strategy.blocking_penalty >= 5000 )
 {

 goto blocked;
 }
 else
 {

 goto increase_block;
 }
 }
 else
 {

 /** */
 if ( true )
 {

 /** */
 if ( strategy.blocking_penalty < 0 )
 {

 goto not_blocked;
 }
 else
 {

 goto decrease_block;
 }
 }
 else
 {

 stay;
 }
 }
 }

## State increase_block

If that state is active,
>  This decimal output symbol is set:
strategy.blocking_penalty  =
 (strategy.blocking_penalty + 100)

The decision tree:

Pseudo code of the decision tree:

 /** */
if (
 ( obstacle.distance_in_direction() < 2000 )
&&
 ( obstacle.distance_in_direction() < (ball.distance() - 100) )
)
 {

 goto blocked;
 }
 else
 {

 /** */
if (
 ( obstacle.obstacle_distance.left() < 200 )
||
 ( obstacle.obstacle_distance.middle() < 200 )
||
 ( obstacle.obstacle_distance.right() < 200 )
)
 {

 /** */
 if ( strategy.blocking_penalty >= 5000 )
 {

 goto blocked;
 }
 else
 {

 goto increase_block;
 }
 }
 else
 {

 /** */
 if ( true )
 {

 /** */
 if ( strategy.blocking_penalty < 0 )
 {

 goto not_blocked;
 }
 else
 {

 goto decrease_block;
 }
 }
 else
 {

 stay;
 }
 }
 }

## State blocked

If that state is active,
>  This decimal output symbol is set:
strategy.blocking_penalty  =
 5000

The decision tree:

Pseudo code of the decision tree:

 /** */
if (
 ( obstacle.distance_in_direction() < 2000 )
&&
 ( obstacle.distance_in_direction() < (ball.distance() - 100) )
)
 {

 goto blocked;
 }
 else
 {

 /** */
if (
 ( obstacle.obstacle_distance.left() < 200 )
||
 ( obstacle.obstacle_distance.middle() < 200 )
||
 ( obstacle.obstacle_distance.right() < 200 )
)
 {

 /** */
 if ( strategy.blocking_penalty >= 5000 )
 {

 goto blocked;
 }
 else
 {

 goto increase_block;
 }
 }
 else
 {

 /** */
 if ( true )
 {

 /** */
 if ( strategy.blocking_penalty < 0 )
 {

 goto not_blocked;
 }
 else
 {

 goto decrease_block;
 }
 }
 else
 {

 stay;
 }
 }
 }