Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> Bot Development >> Setup pruning
(Message started by: tize on Dec 29th, 2011, 11:34am)

Title: Setup pruning
Post by tize on Dec 29th, 2011, 11:34am
Today I started adding support in marwin for actually generating the setup moves by himself and not just pick a move at random from a small list. This is done fully due to the fun-factor as picking a strong setup is not crucial when the opening is played at the level he does now. But I do want the abillity to make him change the setups due to what an evaluation function tells him...

The first test suggest that the normal evaluator is not good at all for this job, so I will have to have a setup evaluator. Anyway, it is a lot of different setups to choose from so I wanted to prune away as many as possible without enforcing to many restrictions.

The pruners I have now is:
weakerOnStronger, prunes a setup if a weaker piece stands infront of a stronger.
elephantOrCamelPositionWrong, prunes a setup if the silver elephant is placed infront of the gold elephant, if elephant/camel isn't placed on any of the B2, C2, D2, E2, F2, G2 squares, or if the gold elephant is placed in the east.
nonRabbitsInRabbitSquares, prunes a setup if the squares A1, C1, F1, and H1 contains a non-rabbit.
horsesBack, prunes all setups that has one or two horses on the back row
rabbitsTogetherOnFrontRow, prunes a setup whenever two rabbits stands next to eachother in the front row
lessThan3RabbitsOnOneSide, prunes a setup when one of the wings have less than 3 rabbits.

With these the numbers go down a lot but I think it's still possible to find more patterns to reduce it even more. Any ideas? Or am I already pruning away potentially good setups?

Gold setups
38301 setup moves generated
 pruned_weakerOnStronger:             63537600
 pruned_elephantOrCamelPositionWrong: 1001625
 pruned_nonRabbitsInRabbitSquares:    249795
 pruned_horsesBack:                   30474
 pruned_rabbitsTogetherOnFrontRow:    5479
 pruned_lessThan3RabbitsOnOneSide:    1526

Silver setups (with the gold elephant on D2)
62945 setup moves generated
 pruned_weakerOnStronger:             63537600
 pruned_elephantOrCamelPositionWrong: 784575
 pruned_nonRabbitsInRabbitSquares:    419592
 pruned_horsesBack:                   48675
 pruned_rabbitsTogetherOnFrontRow:    8819
 pruned_lessThan3RabbitsOnOneSide:    2594

(updated to make it clearer)

Title: Re: Setup pruning
Post by Boo on Dec 29th, 2011, 12:55pm
I would also prune a setup where a rabbit is placed in one of the squares g2 d2 e2 b2.

EDIT - Ahh, if I reread it, it seems those squares are reserved for horses, camel and elephant. But then HHE in one wing (Ha2 Hb2 Ec2) will get pruned.

Title: Re: Setup pruning
Post by Hippo on Dec 29th, 2011, 1:37pm
My bot is very strong on 1s move, compared to the rest of the game;).

Title: Re: Setup pruning
Post by tize on Dec 29th, 2011, 2:12pm

Quote:
My bot is very strong on 1s move, compared to the rest of the game;).

:D


Quote:
I would also prune a setup where a rabbit is placed in one of the squares g2 d2 e2 b2.  

EDIT - Ahh, if I reread it, it seems those squares are reserved for horses, camel and elephant. But then HHE in one wing (Ha2 Hb2 Ec2) will get pruned.


I tested your idea and it worked nice now I get:

GoldSetups
23766 setup moves generated
 ...
 pruned_rabbitInBDEG2:                14535

SilverSetups
38408 setup moves generated
 ...
 pruned_rabbitInBDEG2:                24537

A setup with HHE in one wing will be perfectly fine as the horses are allowed to go any where on the front row, and the elephant and the camel are allowed on B2, C2, D2, E3, F3, G2 (minus the symmerty reduction for gold elephant and opposing gold elephant for the silver one).



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