Author: Sven Reichard
Date: 04:29:31 07/04/02
Go up one level in this thread
On July 04, 2002 at 06:45:40, Sune Fischer wrote:
>>>I don't have a BitBoard class (and I don't see how to make one)?
>>>>
>So would it be possible to do:
>0x001000000000.print(); ?
>It looks really odd to me, usually you can't pass raw numbers as references,
>minor issue perhaps.
No, you can't. 0x001 is not a bitboard, but a number. What you can do is
something like this:
Bitboard a_file(0x0101010101010101ULL);
a_file.print();
Instead of writing these numbers directly in the code, I would probably put
something like
class Bitboard
{
public:
static const Bitboard& file(int which);
}
so, then you just write
Bitboard::file(0).print();
>>>Now the hash is intuitively more a class type object IMO and I have declared it
>>>as a class, but I have two hashes, a pawn- and regular hash and they are not the
>>>same in regards to member variables. The size of these elements must be as small
>>>as possible, so I need two hash classes (unless you can teach me a new trick
>>>here:).
>>
>>Inheritance?! Put everything that is common to both tables in a base class, and
>>derive the hash table and the pawn hash table from it. If you want to go to
>>extremes, write a template class which gets the respective table entries as a
>>parameter.
>
>yeah, ok, if you absolutely must do it OO, but the point of doing it like that
>is very limited when they have no common member vars or functions, IMO.
If there is no common functionality, then there is not point in doing that, I
agree. However, since both are hash tables, I would expect some common things
(updating the zobrist key, finding the correct entry, verifying the entry,
etc.).
>>The only place where you need the hash table is the search algorithm, isn't it?
>
>Some also use the HT for generating PV's, I don't do that, yet.
I have a method HashedAlphaBeta::printPV(std::ostream);
>Besides I could have more "search" instances in a parallel program, so the HT
>would have to at least be static.
>
I haven't found an application of two search algorithms sharing the same HT. The
qsearch, which is in a different class, doesn't use the HT yet. (Maybe that's
why my trees are so big:)) If it does, I can give it access to the instance in
HashedAlphaBeta. BTW, how do you handle the transposition tables in the qsearch?
>>>Hmm, but there is no meaning to the object of an evaluation class.
>>>What _is_ such an object, other than a collection of functions?
>>>The evaluation is connected/related to the Board and not much else, so why
>>>seperate them in two classes?
>>
>>It also depends on the weights that you give to the different features. The
>>classical approach is to have a file containing things like
>>
>>#define DOUBLE_PAWN_PENALTY 42
>>
>>I put these numbers in the evaluation class; so far as constants, but I plan to
>>make the proper state variables, so I can experiment with the parameters without
>>recompiling, or even restarting the program.
>
>Ok, beginning to see your point :)
>These should really vary as the game develops, a passed pawn is usually worth
>more in the endgame, for instance.
>
>>Also, the evaluation class is a good place to put the pawn hash table.
>
>Then what about you fancy hash templete class ;)
>This is one of those things that could be either place, don't you agree?
I didn't mean that the definition goes there, I just meant that the pawn hash
table will be a member variable of the evaluation object.
There's always more than one possibility, so I do agree.
>
>>class RandomGenerator
>>{
>>public:
>> RandomGenerator(unsigned int seed = time());
>> unsigned int drawNext();
>>private:
>> // ...
>>};
>>
>>An implementation is given somewhere in Stroustrup 3rd ed. However, I would
>>prefer to use the library's random generator, if it's any good - GNU's is, I
>>think, don't know about MSVC.
>>
>>Sven.
>
>Ah, I have that book, now I just need to read it;)
>
>-S.
At least you can read it in the original language :))
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.