A B C E G H I M N P R S Z

A

AStar - class AStar.
This is the template for a class that performs A* search on a given rush hour puzzle with a given heuristic.
AStar(Puzzle, Heuristic) - Constructor for class AStar
This is the constructor that performs A* search to compute a solution for the given puzzle using the given heuristic.
AdvancedHeuristic - class AdvancedHeuristic.
This is a template for the class corresponding to your original advanced heuristic.
AdvancedHeuristic(Puzzle) - Constructor for class AdvancedHeuristic
This is the required constructor, which must be of the given form.

B

BlockingHeuristic - class BlockingHeuristic.
This is a template for the class corresponding to the blocking heuristic.
BlockingHeuristic(Puzzle) - Constructor for class BlockingHeuristic
This is the required constructor, which must be of the given form.
BranchingFactor - class BranchingFactor.
This class contains a static method for computing the branching factor, as described in Russell and Norvig (page 106).
BranchingFactor() - Constructor for class BranchingFactor
 

C

compute(int, int) - Static method in class BranchingFactor
This static method computes the branching factor for a search in which num_expanded nodes were expanded, and a solution at the given depth was discovered.

E

equals(Object) - Method in class State
Returns true if and only if this state is considered equal to the given object.
expand() - Method in class Node
Expands this node, in other words, computes all of the nodes immediately reachable from this node according to the rules of the puzzle and returns them as an array of nodes.
expand() - Method in class State
Computes all of the states immediately reachable from this state and returns them as an array of states.

G

getCarOrient(int) - Method in class Puzzle
Returns the orientation of car v, where true means that the car is vertically oriented.
getCarSize(int) - Method in class Puzzle
Returns the size (length) of car v.
getDepth() - Method in class Node
Returns the depth of this node.
getFixedPosition(int) - Method in class Puzzle
Returns the fixed position of car v.
getGrid() - Method in class State
Computes a grid representation of the state.
getGridSize() - Method in class Puzzle
Returns the grid size of this puzzle, i.e., the length along each side.
getInitNode() - Method in class Puzzle
Returns the initial (root) node of this puzzle.
getName() - Method in class Puzzle
Returns the name of this puzzle.
getNumCars() - Method in class Puzzle
Returns the number of cars for this puzzle.
getParent() - Method in class Node
Returns this node's parent node.
getPuzzle() - Method in class State
Returns the puzzle associated with this state.
getSearchCount() - Method in class Puzzle
Returns the current value of the search counter, which keeps a count of the number of nodes generated on the current search.
getState() - Method in class Node
Returns the state associated with this node.
getValue(State) - Method in class AdvancedHeuristic
This method returns the value of the heuristic function at the given state.
getValue(State) - Method in class BlockingHeuristic
This method returns the value of the heuristic function at the given state.
getValue(State) - Method in interface Heuristic
Returns the value of the heuristic function at the given state.
getValue(State) - Method in class ZeroHeuristic
Returns the value of the heuristic, which is always zero.
getVariablePosition(int) - Method in class State
Returns the variable position of car v.

H

Heuristic - interface Heuristic.
This is the interface that all heuristics must implement.
hashCode() - Method in class State
Returns a hash code value for this State object.

I

incrementSearchCount(int) - Method in class Puzzle
Increments the search counter by d.
isGoal() - Method in class State
Returns true if and only if this state is a goal state.

M

main(String[]) - Static method in class RushHour
The main for running all puzzles with all heuristics, and printing out all solution paths as well as a final summary table.

N

Node - class Node.
This is the class for representing a single search node.
Node(State, int, Node) - Constructor for class Node
The main constructor for constructing a search node.

P

Puzzle - class Puzzle.
This is the class for representing a particular rush hour puzzle.
Puzzle(String, int, int, boolean[], int[], int[], int[]) - Constructor for class Puzzle
The main constructor for constructing a puzzle.
path - Variable in class AStar
The solution path is stored here
print() - Method in class State
Prints to standard output a primitive text representation of the state.

R

RushHour - class RushHour.
This class contains only a simple main for testing your algorithm on data with one or more heuristics.
RushHour() - Constructor for class RushHour
 
readPuzzlesFromFile(String) - Static method in class Puzzle
A static method for reading in a list of puzzles from the data file called filename.
resetSearchCount() - Method in class Puzzle
Resets the search counter to 1 (for the initial node).

S

State - class State.
This is the class for representing a single state of the rush hour puzzle.
State(Puzzle, int[]) - Constructor for class State
The main constructor for constructing a state.

Z

ZeroHeuristic - class ZeroHeuristic.
This is a trivial heuristic function that always returns zero.
ZeroHeuristic(Puzzle) - Constructor for class ZeroHeuristic
A vacuous constructor, provided in this form for consistancy with the other Heuristic implementations.

A B C E G H I M N P R S Z