Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> Bot Development >> Rabbit Evaluation in Bomb
(Message started by: fotland on Feb 14th, 2007, 12:59am)

Title: Rabbit Evaluation in Bomb
Post by fotland on Feb 14th, 2007, 12:59am
Blocking - each rabbit gets a 5 pt bonus if it has a rabbit, dog or cat adjacent (to side, side and up, side and down).  5 points for each side, so 10 points maximum.  This is really fast since it's just one bitmap operation for each side.

Passed - advanced rabbits get a bonus (by rank) if there are no rabbits ahead in this file or the ones to either side.  0, 10, 20, 30, 50, 75, 100, 0,

Mate threat.  Each rabbit gets evaluated for the number of steps it takes reach the goal:

6000,      // enemy pushed me to edge, but not mate yet
5000, 5000, 4000, 2000,  // goal inevitable, but 4 sometimes wrong
300, 275, 250, 200,      // enemy has 4 or more save moves      
175, 150, 125, 100,  90, 80, 60, 30, 0,  


Calculate power balance of advanced rabbits on ranks 5 through 7.  This is the sum for each non-rabbit unfrozen piece of a value depending on the piece multiplied by a value depending on the taxicab distance to the point in front of the rabbit.  The value is clipped to +1200.

                       bmap pcs = p[WPIECES];
                       pcs.bmor(p[BPIECES]);
                       pcs.andnot(p[WPAWN]);
                       pcs.andnot(p[BPAWN]);
                       pcs.andnot(frozen);
                       int total = 0;
                       while(!pcs.isempty()){
                             int bit = pcs.nextbit();
                             total += (int)(pawnpieceval[pieceat(bit)]*pawndistval[taxidistance[bit][loc-8]);      // dist to ahead one row
                       }


// value for a pawn helper piece
static int pawnpieceval[13] = {
0,  0,  45,  60,  150,  200,  300,
    0, -45, -60, -150, -200, -300
};

// multiplier for pawnpieceval depending on distance
static double pawndistval[16] = {
1.0, 1.0, 1.0, 0.9, 0.7, 0.3, 0.2, 0.15, 0.10, 0.05, 0.04, 0.03, 0.02, 0.01, 0, 0,
};

If the power balance is negative, this is a weak rabbit, and we evaluate it as -30.  Otherwise it's a strong rabbit, and we evaluate it by multiplying the power balance by a a factor depending on the rank and another factor that depends on the number of steps to the mate.  If the rabbit is on a trap, we divide this by 2.

int pval = (int)(total*pawnrankval[rank[loc]*mateval[matesteps]);      // strong pawn

static double pawnrankval[4] = { 0, 1.5, 1.0, .5 };      // more value for more advanced pawn

static double mateval[MANYSTEPS+1] = {      // more value if fewer steps to mate
     1.0,
     1.0, 1.0, 1.0, 1.0,
     1.0, 1.0, 1.0, 0.9,
     0.8, 0.7, 0.6, 0.5,
     0.4, 0.3, 0.2, 0.1,
     0.08
};


Lots of arbitrary parameters, but it seems to work ok in practice.



Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.