Computer Chess Club Archives


Search

Terms

Messages

Subject: rewriting alpha beta(thanks in advance for advices)

Author: Uri Blass

Date: 03:44:06 12/11/03


I deciding that I probably need to rewrite my alphabeta function to make changes
in the search easier to do.

some questions about it:

1)When do you calculate extensions
Today I call alphabeta immediately after makemove and alphabeta calculate the
extensions(I think it should be done before it).

2)Another thing that I need to change is the way that I calculate extensions and
today they are calculated in 2 varaibles when one of them is the partial
extensions and it may be better to have one varaible.

3)Another thing that I consider to change is my sort function.

Mine is similiar to tscp and get the number of move in the stack as a parameter
and I remember from a post of Tord that he simply has a function to pick moves
that does not get varaibles.

Even without changing this structure I suspect that my replace between moves is
not efficient

Here is the start of my sort function.

void sort(int from)
{
	int i=0;
	int bs;  /* best score */
	int bi;  /* best i */
	gen_t g;
	bi=from;
	switch (phase[ply])
	{
	case pvnode:
		{
			follow_pv = 0;
			phase[ply]=goodcapture;
			for(i = first_move[ply]; i < first_move[ply + 1]; ++i)
				if (gen_dat[i].m.u == pv[0][ply].u)
				{
					follow_pv = 1;
					g = gen_dat[first_move[ply]];
					gen_dat[first_move[ply]] = gen_dat[i];
					gen_dat[i] = g;
					break;
				}
				if (follow_pv)
					break;
		}


first:
I can do it faster by noticing that the move is illegal in part of the cases
but it is not very important because the case of pvnode is clearly rare.

I think that what I do is not efficient because when I use switch command, I
should not start with something rare and case pvnode is clearly something rare
but I do not know exactly how to change it at this moment to something more
efficient.

Another point is how to replace between 2 unions in an efficient way because my
move is a union between struct of 4 chars and int.

I remember a post of david omid about replacing between 2 ints in an efficient
way without a third varaible but I do not know what is the best efficient way to
do it for unions of struct of 4 chars and int.

Uri



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.