|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectextended.FirstChoiceStrategy<T>
T
- the specific type of all elements in the search domain.public class FirstChoiceStrategy<T>
A hill climbing strategy which selects the first successor which is better then the current state.
It is one of the standard HillClimbingStrategy implementations usable in the hill climbing search.
It obeys all constraints from the interface definition, and is able to return
equal states whenever no better state can be found.
This strategy is faster then the other because it does not look at all the successors.
On the other hand the hill climbing itself will need more steps to find an optimum.
HillClimbing
,
HillClimbingStrategy
,
BestChoiceStrategy
Constructor Summary | |
---|---|
FirstChoiceStrategy()
Creates a new FirstChoiceStrategy which can be employed in the hill climbing search. |
Method Summary | |
---|---|
T |
select(HillClimbing<T> hc,
java.util.List<T> list,
T current)
This method selects the first state in the extension list which is better then the current state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FirstChoiceStrategy()
Method Detail |
---|
public T select(HillClimbing<T> hc, java.util.List<T> list, T current)
hillclimbing.compare(current,state) > 0
).
If there is a state which is equal (in fact hillclimbing.compare(current,state) = 0
)
to the current state it is remembered, for the case that no better state can be found.
select
in interface HillClimbingStrategy<T>
hc
- the hill climbing search itself (which must be used as a comparator)list
- the list of successors of the current statecurrent
- the current state of the hill climbing search
HillClimbingStrategy.select(extended.HillClimbing, java.util.List, java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |