Class ChAbstractPositionReadMap
- All Implemented Interfaces:
PositionReadMap
- Direct Known Subclasses:
AbstractPositionReadWriteMap, ChFilePositionMap
- Author:
- BerniMan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassclassclassclassclassstatic interfacestatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected chesspresso.position.map.ChAbstractPositionReadMap.GameModelListModel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfindHotSpots(Position pos, ChAbstractPositionReadMap.IChPositionEvaluator evaluator, int numOfHotspots, ChAbstractPositionReadMap.PositionDataListener listener) voidfindHotSpots(Position pos, ChAbstractPositionReadMap.IChPositionSelector selector, ChAbstractPositionReadMap.PositionDataListener listener) getAllGames(Position pos) / private void getAllGames(ChPosition pos, Hashtable table, Hashtable gameTable) / { / if (table.containsKey(new Long(pos.getHashCode()))) return; // =====> / table.put(new Long(pos.getHashCode()), Boolean.TRUE); / / IChPositionData data = getData(pos); / if (data == null) return; // =====> / if (data instanceof ChPositionDataGame) { / ChPositionDataGame gameData = (ChPositionDataGame)data; /// if (gameTable.containsKey(new Long(gameData.getGamePointer()))) return; // =====> /// gameTable.put(new Long(gameData.getGamePointer()), Boolean.TRUE); / System.out.println(data.getGame()); / } else { / short[] moves = pos.getAllMoves(); /// System.out.println("("); / for (int i = 0; i < moves.length; i++) { / try { / pos.doMove(moves
);invalid reference
i/ IChPositionData moveData = getData(pos); / if (moveData !
getData(ImmutablePosition pos) intfinal doublegetMiniMax(Position pos, int depth, int minGames, boolean takePerformance, short[] bestLine) voidvoidprint()voidsetGameOffset(int offset) voidwriteGames(DataOutput gameIndices, File gamesFile, int headerMode, int movesMode) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PositionReadMap
close, containsGameModel, getData, getDataIterator, getGameModel, getGameModel, getGameModelIndex, getGameModelIterator, getLargestCounterDifference, getLargestGameCounter, getNumOfData, getNumOfGames, getNumOfPositions, printPerformanceStatistics
-
Field Details
-
m_gameModelListModel
protected chesspresso.position.map.ChAbstractPositionReadMap.GameModelListModel m_gameModelListModel
-
-
Constructor Details
-
ChAbstractPositionReadMap
public ChAbstractPositionReadMap()
-
-
Method Details
-
getGameModelListModel
- Specified by:
getGameModelListModelin interfacePositionReadMap
-
getData
- Specified by:
getDatain interfacePositionReadMap
-
getAllSelectors
-
getAllEvaluators
-
getNumOfGamesEvaluator
-
getResultEvaluator
-
getWeightedResultEvaluator
-
getEloEvaluator
-
getDeltaPerformanceEvaluator
-
getEntropyEvaluator
public ChAbstractPositionReadMap.ChEntropyEvaluator getEntropyEvaluator(ChAbstractPositionReadMap.IChPositionEvaluator e) -
getMiniMax
public final double getMiniMax(Position pos, int depth, int minGames, boolean takePerformance, short[] bestLine) -
findHotSpots
public void findHotSpots(Position pos, ChAbstractPositionReadMap.IChPositionSelector selector, ChAbstractPositionReadMap.PositionDataListener listener) -
findHotSpots
public void findHotSpots(Position pos, ChAbstractPositionReadMap.IChPositionEvaluator evaluator, int numOfHotspots, ChAbstractPositionReadMap.PositionDataListener listener) -
getAllGames
/ private void getAllGames(ChPosition pos, Hashtable table, Hashtable gameTable) / { / if (table.containsKey(new Long(pos.getHashCode()))) return; // =====> / table.put(new Long(pos.getHashCode()), Boolean.TRUE); / / IChPositionData data = getData(pos); / if (data == null) return; // =====> / if (data instanceof ChPositionDataGame) { / ChPositionDataGame gameData = (ChPositionDataGame)data; /// if (gameTable.containsKey(new Long(gameData.getGamePointer()))) return; // =====> /// gameTable.put(new Long(gameData.getGamePointer()), Boolean.TRUE); / System.out.println(data.getGame()); / } else { / short[] moves = pos.getAllMoves(); /// System.out.println("("); / for (int i = 0; i < moves.length; i++) { / try { / pos.doMove(moves
);invalid reference
i/ IChPositionData moveData = getData(pos); / if (moveData != null && data.wasMovePlayed((short)moves
)) {invalid reference
i/// System.out.println(ChMove.getString(moves
));invalid reference
i/ getAllGames(pos, table, gameTable); / } / pos.undoMove(); / } catch (ChIllegalMoveException ex) {} / } /// System.out.println(")"); / } / }
-
setGameOffset
public void setGameOffset(int offset) - Specified by:
setGameOffsetin interfacePositionReadMap
-
getGameOffset
public int getGameOffset()- Specified by:
getGameOffsetin interfacePositionReadMap
-
initForWriting
public void initForWriting()- Specified by:
initForWritingin interfacePositionReadMap
-
writeGames
public void writeGames(DataOutput gameIndices, File gamesFile, int headerMode, int movesMode) throws IOException - Throws:
IOException
-
print
public void print()
-