State module
- class State.State(board, parentstate, depth, fvalue=0)
Bases:
object
This class represents the state of the game.
- Parameters
board (
Board.Board
) – the actual board that belongs to this stateparentstate (
State.State
) – the State that the current State came from after applying a legal movedepth (int) – the depth of the current state (number of moves made)
f-value (int, optional) – the priority order of the state; some heuristic function of the state. Defaults to 0
- Attributes
:board (
Board.Board
): number of rows:parentstate (
State.State
) the State prior to current state- depth (int)
depth of state
- fvalue (int)
priorty order of the state. The value of some heuristic function. Defaults to 0
- printPath()
A function to print a complated path from the initial state to the solution state. This function calls print() statements directly, rather than returning a string.
- Returns
None