Package libai.search
Class State
- java.lang.Object
-
- libai.search.State
-
-
Constructor Summary
Constructors Constructor Description State()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract int
compareTo(State o)
Compare two statesabstract boolean
equals(java.lang.Object o)
Determines if two states are equals or equivalentsabstract java.util.ArrayList<State>
getCandidates()
Returns a list with all the possible candidates from this stateabstract double
getCost()
Get the cost of the current stateabstract double
getHeuristicCost()
Get the heuristic cost of the current stateabstract int
hashCode()
Hash code of the state MUST BE implemented to keep track of the visited statesabstract boolean
isSolution()
Determines if the current state is a solution or not
-
-
-
Method Detail
-
getCost
public abstract double getCost()
Get the cost of the current state- Returns:
- cost of the current state
-
getHeuristicCost
public abstract double getHeuristicCost()
Get the heuristic cost of the current state- Returns:
- heuristic cost of the current state
-
getCandidates
public abstract java.util.ArrayList<State> getCandidates()
Returns a list with all the possible candidates from this state- Returns:
- list with all the possible candidates from this state
-
compareTo
public abstract int compareTo(State o)
Compare two states- Specified by:
compareTo
in interfacejava.lang.Comparable<State>
-
hashCode
public abstract int hashCode()
Hash code of the state MUST BE implemented to keep track of the visited states- Overrides:
hashCode
in classjava.lang.Object
-
equals
public abstract boolean equals(java.lang.Object o)
Determines if two states are equals or equivalents- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
-o
-
isSolution
public abstract boolean isSolution()
Determines if the current state is a solution or not- Returns:
true
if the current state is a solution andfalse otherwise
-
-