Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Design: what would your objects be?

Author: Sune Fischer

Date: 07:32:21 07/03/02

Go up one level in this thread


On July 03, 2002 at 08:50:12, Daniel Clausen wrote:

>>Should I make a special evaluation class, seems it would always and
>>only depend on the Board.
>
>I have an Evaluator class. (the method evaluate(const Board& board, int alpha,
>int beta) is static) The method evaluate itself calls several static methods
>again which don't belong to the public interface though. I want my board class
>to only provide simple methods like 'toFEN()' and stuff like that.

I still do not see a reason for making a special evaluation class.
The first C++ program I saw was an example with a Box class, he made member
variables called length, height and width, and a function called Volume, so he
could do mybox.Volume() etc.

I think in this sense my Board is equivalent to his Box, and my Eval to his
Volume, it is an 'operator' on the object, so the function belongs as a member
function to the class of the object.

If we have function F dependent on x and y, where x and y are different class
objects, then it is not clear to me where F should go, but if x and y are in the
same class then F should be a member of that class.
At least that is the way I understood it, but perhaps my math schooling is
blocking me here? :)

>
>>ProbeHash() - should the hash be an object, it needs a Board.
>
>HashTable will be an object in my case. (with non-static methods) This way it's
>easy to have multiple hashtable objects (maybe I want that later, maybe I don't)

I have the hashtable element as a class, the allocation to an array is not
formally part of a class, it's just an array of hash objects.

-S.



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.