Repo for the 2014 GE Case Study
Keep in mind these notes are a result of my analysis, so they could be wrong
- Is consulted on generation of every piece, and then the resulting Move is used to determine the movement of the pieces, where it distributes the moves over ticks in order of ROTATION, and then TRANSLATION
- Iterates through every rotation, then every column
- Uses a BoardRater to rate the resultant board, then chooses the Move with the lowest (best) score
This section will elaborate on the various heuristics the included AI uses to rate a given tetris board.
Returns the largest number of holes per column. For each column, the number of "holes" (the number of empty spaces) is counted. The largest sum is returned.
Returns the sum of the number of blocks (including holes) above the first "hole" in each column
Returns the sum of the number of consecutive horizontal holes in each column
Returns the average height of each column
Returns the height of the tallest column
Returns the difference between the highest and lowest columns
Returns the standard deviation of the board. This is the square root of the variance
Returns the variance of the heights of the columns. This is how spread out the values are
Returns the number of holes in the column with the most holes
Returns the total number of holes in the board
Returns the variance between the variances of each column of three
Returns the number of columns with at least one block in it
Returns a weighted value that treats holes near the bottom as a higher penalty than holes near the top
- Move.piece should be the orientation we want to rotate the piece
- Move.x and Move.y should be the position of the center of the piece, however only Move.x is used to translate the piece
- The actual Piece object contains methods for retrieving various data about the piece
- A Piece with the same shape, yet different rotations are not equal as a rotation of the piece actually rearranges the body (or the points that makeup the piece)
- There is a method for finding how tall a given column of the piece is (getSkirt())
- Consequently, Piece.getWidth() == Piece.getSkirt().length