Evaluation as a composite

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Evaluation as a composite

Post by Henk »

Code for evaluation getting complicated easily. I wonder if using a composite design pattern wouldn't be best.

https://en.wikipedia.org/wiki/Composite_pattern

[Actually I've bad experience with some design patterns because of making it slow or even more complicated]
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Evaluation as a composite

Post by Henk »

It is more complicated than that. For evaluator is a strategy and a state of search(er) as well. For instance evaluator should change it's behavior when in end game
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Evaluation as a composite

Post by lucasart »

Henk wrote:Code for evaluation getting complicated easily. I wonder if using a composite design pattern wouldn't be best.

https://en.wikipedia.org/wiki/Composite_pattern

[Actually I've bad experience with some design patterns because of making it slow or even more complicated]
Don't waste your time with this object oriented crap. If you cannot write it simply, in procedural form, then you don't understand what you're doing, and making it object oriented and using fancy design pattern won't help. On the contrary, it makes things harder, because you end up having to solve problems that weren't there to begin with, but emerged as a result of your spaghetti web of object oriented patterns.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Evaluation as a composite

Post by Henk »

Some are even using a (neural) network for evaluation. Black box nobody understands.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Evaluation as a composite

Post by Ras »

lucasart wrote:Don't waste your time with this object oriented crap.
On the upside, one can ponder the whole day about faux problems like "is-a vs. has-a", jiggle around object hierarchies and architect stuff like object model abstract controller manager factories (any permutation or even combination will do). 8-)
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: Evaluation as a composite

Post by kbhearn »

While I'm probably going to regret replying to this...

The main issue is you're taking a solution and going looking for a problem. What do you find unmanageable about your current evaluation and how does this address it to make it more manageable? Nothing about a tree structure with a variety of node types that need to be handled almost the same but slightly differently screams evaluation to me.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Evaluation as a composite

Post by lucasart »

Henk wrote:Some are even using a (neural) network for evaluation. Black box nobody understands.
Clearly you have no clue what you're doing… You're confusing the faux problems (syntactic bullshit like OOP and design patterns) with the method of resolution of the actual problem (how to evaluate chess position).
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
flok

Re: Evaluation as a composite

Post by flok »

lucasart wrote:
Henk wrote:Some are even using a (neural) network for evaluation. Black box nobody understands.
Clearly you have no clue what you're doing… You're confusing the faux problems (syntactic bullshit like OOP and design patterns) with the method of resolution of the actual problem (how to evaluate chess position).
That doesn't matter: as long as he's having fun all is good.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Evaluation as a composite

Post by Henk »

By the way does anybody know why Stockfish doesn't use a neural network for it's evaluation.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Evaluation as a composite

Post by Henk »

Maybe I like small files. When file gets too big my eyes getting tired of searching. Also makes it more difficult when editing.