Chess MapReduce Application

From CSE231 Wiki
Revision as of 03:20, 19 March 2024 by Cosgroved (talk | contribs) (→‎Client)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code To Investigate and Implement

ChessMapper

class: ChessMapper.java Java.png
methods: constructor
isMoveAtIndexDesired
map
package: mapreduce.apps.chess.exercise
source folder: student/src/main/java

constructor and instance variable

method: public ChessMapper(IntPredicate isMoveAtIndexDesired) Sequential.svg (sequential implementation only)

Hang onto the value of the isMoveAtIndexDesired parameter as an instance variable for later use.

isMoveAtIndexDesired

This method exists largely as a reminder to use the isMoveAtIndexDesired passed to the constructor.

map

Note: the ChessMapper is constructed with an IntPredicate. This IntPredicate should be passed to each game's positionResponsePairs method to potentially limit how many pairs you will emit.

method: public List<Map.Entry<Position, MoveResultPair>> map(Game game) Sequential.svg (sequential implementation only)

ChessReducer

class: ChessReducer.java Java.png
methods: reduce
package: mapreduce.apps.chess.exercise
source folder: student/src/main/java

reduce

method: public Map<Move, ResultTotalInfo> reduce(List<MoveResultPair> moveResultPairs) Sequential.svg (sequential implementation only)

Attention niels epting.svg Warning:This class inherits from ClassicReducer. Be sure to have completed that exercise first.

Tip: You may notice that you cannot directly call the constructor for ResultTotalInfo. A ResultTotalInfo object is immutable, but a ResultTotalInfo.Builder is not. Accumulate game results into this ResultTotalInfo.Builder object, and when it is complete, call .build(), and this will return a ResutlTotalInfo object with all game results.

Testing Your Solution

class: __ChessMapReduceAppTestSuite.java Junit.png
package: mapreduce.apps.chess.exercise
source folder: testing/src/test/java

Client

class: OpeningExplorerApp.java CLIENT
package: mapreduce.apps.chess.viz
source folder: student/src/main/java

What Would Jose Capablanca Do.png

Pledge, Acknowledgments, Citations

file: mapreduce-chess-app-pledge-acknowledgments-citations.txt

More info about the Honor Pledge