Re: How to: referencing variables using the contents of otehr variables.
- From: fguy64s@xxxxxxxxx
- Date: Wed, 15 Apr 2009 11:01:56 -0700 (PDT)
On Apr 15, 1:33 pm, Joshua Cranmer <Pidgeo...@xxxxxxxxxxxxxxx> wrote:
fguy...@xxxxxxxxx wrote:
Just keeping track of the move sequence in a game is one thing, but
when it comes down to analysing a few moves deep. You end up
comparing and evaluating many thousands of positions each with their
own set of pieces. so if a piece is an object, if you don't do it
right the overhead associated with keeping track of all these objects
is tremendous.
You're essentially balking because you think it won't be fast. You don't
have proof of where the slowdown is, and I don't think you're skilled
enough to guess: I sure as hell am not sufficiently skilled to be
reasonably accurate.
I am willing to bet, however, that the speed differences in your
representation here is going to be dwarfed by algorithmic choices.
Probably, the overhead would be less than the noise threshold. At the
very least, before you complain, show us proof that the overhead is
where your bottleneck.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Not at all. The particular comment you quoted referred to a suggestion
simply that a piece should be an object. I wasn't balking at anyone's
suggestion because it would be slow. But I have tried a number of
methods, including some that use pieces as objects. There are a few
different ways to skin a cat with regards to pieces as objects, I've
even tried a few. Some methods work better than others. In fact I have
learned that choices on data structure can have a very significant
impact on overall speed.
But with regards to enums in particular, That did go a little beyond
the reason for my original question. I'll probably end up giving enums
or polymorphism a try, just not quite yet. I want to get the most out
of my current data structure before I try a different one.
If you're familiar with FEN notation, all information about a chess
position is described by the characteristics of a position, once a
move is completed, the history of what a piece has been doing is
mostly irrelevant.
regards.
.
- References:
- How to: referencing variables using the contents of otehr variables.
- From: fguy64s
- Re: How to: referencing variables using the contents of otehr variables.
- From: Mark Space
- Re: How to: referencing variables using the contents of otehr variables.
- From: fguy64s
- Re: How to: referencing variables using the contents of otehr variables.
- From: Joshua Cranmer
- Re: How to: referencing variables using the contents of otehr variables.
- From: Patricia Shanahan
- Re: How to: referencing variables using the contents of otehr variables.
- From: fguy64s
- Re: How to: referencing variables using the contents of otehr variables.
- From: Joshua Cranmer
- How to: referencing variables using the contents of otehr variables.
- Prev by Date: Re: How to: referencing variables using the contents of otehr variables.
- Next by Date: Re: JSTL Confusion with <c:set>
- Previous by thread: Re: How to: referencing variables using the contents of otehr variables.
- Next by thread: Re: How to: referencing variables using the contents of otehr variables.
- Index(es):
Relevant Pages
|