net.sourceforge.domian.test.benchmark
Class ConcurrentQueenPuzzle
java.lang.Object
net.sourceforge.domian.entity.AbstractEntity
net.sourceforge.domian.entity.AbstractUUIDEntity
net.sourceforge.domian.test.benchmark.AbstractQueenPuzzle
net.sourceforge.domian.test.benchmark.ConcurrentQueenPuzzle
- All Implemented Interfaces:
- Entity
class ConcurrentQueenPuzzle
- extends AbstractQueenPuzzle
An amusing little computing task involving (possible) vast numbers of repository inserts, updates, and search.
In detail, it consists of:
Generating random chess piece constellations consisting of 8 pieces, disguised as entity objects; adding them to a repository
A batch processing task, iterating through all constellations, doing a little check, with a conditional update
A search task for all constellations solving the queen puzzle
A completion control search task for all constellations not processed (should be none)
The batch processing task tries to solve the infamous "Queen Puzzle" which seeks to find all possible chess queen piece constellations
where none of the queens are threatened by one of the other queens.
A standard 8 x 8 chess board and 8 queen pieces are hard-coded.
Possible sequences of queens are staggering 64^8 = 281.474.976.710.656 (over 280 trillions!)
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ConcurrentQueenPuzzle
ConcurrentQueenPuzzle(AbstractQueenPuzzle.RepositoryType repositoryType,
long numberOfConstellations,
int numberOfWorkers,
long logInterval)
solvePuzzle
void solvePuzzle()
- Specified by:
solvePuzzle
in class AbstractQueenPuzzle
Copyright © 2008-2010. All Rights Reserved.