net.sourceforge.domian.test.benchmark
Class SequentialQueenPuzzle

java.lang.Object
  extended by net.sourceforge.domian.entity.AbstractEntity
      extended by net.sourceforge.domian.entity.AbstractUUIDEntity
          extended by net.sourceforge.domian.test.benchmark.AbstractQueenPuzzle
              extended by net.sourceforge.domian.test.benchmark.SequentialQueenPuzzle
All Implemented Interfaces:
Entity

final class SequentialQueenPuzzle
extends AbstractQueenPuzzle

An amusing little computing task involving (possible) vast numbers of repository inserts, updates, and search.

In detail, it consists of:

  1. Generating random chess piece constellations consisting of 8 pieces, disguised as entity objects; adding them to a repository
  2. A batch processing task, iterating through all constellations, doing a little check, with a conditional update
  3. A search task for all constellations solving the queen puzzle
  4. 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!)


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sourceforge.domian.test.benchmark.AbstractQueenPuzzle
AbstractQueenPuzzle.RepositoryType
 
Field Summary
 
Fields inherited from class net.sourceforge.domian.test.benchmark.AbstractQueenPuzzle
logInterval, numberOfConstellations, numberOfWorkers, processedQueenPuzzleConstellations, queenPuzzleConstellationsThatInherentlySolvesTheQueenPuzzle, queenPuzzleConstellationsThatIsProcessedAndMarkedAsToSolveTheQueenPuzzle, repositoryType, successfulQueenPuzzleConstellations, unProcessedQueenPuzzleConstellations
 
Fields inherited from class net.sourceforge.domian.entity.AbstractUUIDEntity
entityId
 
Fields inherited from class net.sourceforge.domian.entity.AbstractEntity
timeOfCreation, version
 
Constructor Summary
SequentialQueenPuzzle(AbstractQueenPuzzle.RepositoryType repositoryType, java.lang.Long numberOfConstellations, long logInterval)
           
 
Method Summary
(package private)  java.util.Collection<? extends QueenPuzzleConstellation> getSuccessfulQueenPuzzleConstellations()
           
(package private)  void solvePuzzle()
           
 
Methods inherited from class net.sourceforge.domian.test.benchmark.AbstractQueenPuzzle
addOneWellKnownSuccessfulQueenPuzzleConstellationInto, createRepository, doCompletionControl, doPersist, doPrintProcessStatistics, doRepartition, doResultSearch, generateQueenPuzzleConstellationsAndPutInto
 
Methods inherited from class net.sourceforge.domian.entity.AbstractUUIDEntity
getEntityId
 
Methods inherited from class net.sourceforge.domian.entity.AbstractEntity
doWarnLog, equals, getTimeOfCreation, getVersion, hashCode, isEntity, isValueObject, setVersion, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequentialQueenPuzzle

SequentialQueenPuzzle(AbstractQueenPuzzle.RepositoryType repositoryType,
                      java.lang.Long numberOfConstellations,
                      long logInterval)
Method Detail

getSuccessfulQueenPuzzleConstellations

java.util.Collection<? extends QueenPuzzleConstellation> getSuccessfulQueenPuzzleConstellations()

solvePuzzle

void solvePuzzle()
Specified by:
solvePuzzle in class AbstractQueenPuzzle


Copyright © 2008-2010. All Rights Reserved.