Author: Daniel Clausen
Date: 14:46:08 07/03/02
Go up one level in this thread
On July 03, 2002 at 10:32:21, Sune Fischer wrote: >I still do not see a reason for making a special evaluation class. Well I surely won't force you to create one. :) We already both have a Board and a Game class, so it's good that we also have different classes. :) >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. Well, calculating the volume in this case is a rather trivial task. Similarly, if I wanted to count the number of pieces on the board, I would also put this method in the class Board. But evaluating a board position is far more IMHO. Maybe I want to have different evaluation classes, for example one for the opening, one for the middlegame and one for the endgame. Of course I could make 3 methods in the board class for this. but my intuition tells me this is not a good thing. >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? :) Are you sure that all you'll need to evaluate a position is the position itself? What if you want to do lazy evaluation based on [alpha, beta]? Or maybe you want to store certain parts of the evaluation into a hashtable (for example pawn evaluation in the pawn-hashtable) so you can look it up next time. Do you want your board class to be dependent on the pawn-hashtable? Or maybe you want to evaluate 'tactical positions' in favour of your engine, if your opponent doesn't have a lot of time. That's another dependency. And so on. Maybe Sven has some more input here. It seems that he can explain things way better than I can. :) Just a final note though: There is no right or wrong design, just good ones which support you in whatever you're trying to accomplish, and bad ones, which hinder you to do so. Sargon
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.