www.delorie.com/gnu/docs/gnugo/gnugo_193.html search
GNU Go Documentation

 [ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

## 16.6 The Core of the Influence Function

While most of the engine uses the one dimensional board (@xref{The Board}) the two dimensional board is still used in `engine/influence.c'.

Let `(m, n)` be the coordinates of the influence source and `(i, j)` the coordinates of a an intersection being visited during propagation, using the same notation as in the `accumulate_influence()` function. Influence is now propagated to its eight closest neighbors, including the diagonal ones, according to the follow scheme:

For each of the eight directions `(di, dj)`, do:

1. Compute the scalar product `di*(i-m) + dj*(j-n)` between the vectors `(di,dj)` and `(i,j) - (m,n)`
2. If this is negative or zero, the direction is not outwards and we continue with the next direction. The exception is when we are visiting the influence source, i.e. the first intersection, when we spread influence in all directions anyway.
3. If `(i+di, j+dj)` is outside the board or occupied we also continue with the next direction.
4. Let S be the strength of the influence at `(i, j)`. The influence propagated to `(i+di, j+dj)` from this intersection is given by `P*(1/A)*D*S`, where the three different kinds of damping are:

• The permeability `P', which is a property of the board intersections. Normally this is one, i.e. unrestricted propagation, but to stop propagation through e.g. one step jumps, the permeability is set to zero at such intersections through pattern matching. This is further discussed below.
• The attenuation `A', which is a property of the influence source and different in different directions. By default this has the value 3 except diagonally where the number is twice as much. By modifying the attenuation value it is possible to obtain influence sources with a larger or a smaller effective range.
• The directional damping `D', which is the squared cosine of the angle between `(di,dj)` and `(i,j) - (m,n)`. The idea is to stop influence from "bending" around an interfering stone and get a continuous behavior at the right angle cutoff. The choice of the squared cosine for this purpose is rather arbitrary, but has the advantage that it can be expressed as a rational function of `m', `n', `i', `j', `di', and `dj', without involving any trigonometric or square root computations. When we are visiting the influence source we let by convention this factor be one.

Influence is typically contributed from up to three neighbors "between" this intersection and the influence source. These values are simply added together. As pointed out before, all contributions will automatically have been made before the intersection itself is visited.

When the total influence for the whole board is computed by `compute_influence()`, `accumulate_influence()` is called once for each influence source. These invocations are totally independent and the influence contributions from the different sources are added together.

 [ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

 webmaster delorie software   privacy Copyright © 2003   by The Free Software Foundation Updated Jun 2003