extended
Class BestChoiceStrategy<T>

java.lang.Object
  extended by extended.BestChoiceStrategy<T>
Type Parameters:
T - the specific type of all elements in the search domain.
All Implemented Interfaces:
HillClimbingStrategy<T>

public class BestChoiceStrategy<T>
extends java.lang.Object
implements HillClimbingStrategy<T>

A hill climbing strategy which selects the best successor upon all successor states. It is one of the standard HillClimbingStrategy implementations usable in the hill climbing search.

In general this strategy will produce good result in view search steps, but is more likely to trip into local optimum during search. In fact to compare all successor states is slow for large lists and will produce a leak of performance for big optimization problems.

Author:
eden06
See Also:
HillClimbing, HillClimbingStrategy, FirstChoiceStrategy

Constructor Summary
BestChoiceStrategy()
          Creates a new BestChoiceStrategy 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 best state of all states in the extension list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BestChoiceStrategy

public BestChoiceStrategy()
Creates a new BestChoiceStrategy which can be employed in the hill climbing search.

Method Detail

select

public T select(HillClimbing<T> hc,
                java.util.List<T> list,
                T current)
This method selects the best state of all states in the extension list.
It walks over the howl list from a random starting point and tries to find the best state according to the HillClimbing#compare method.

Specified by:
select in interface HillClimbingStrategy<T>
Parameters:
hc - the hill climbing search itself (which must be used as a comparator)
list - the list of successors of the current state
current - the current state of the hill climbing search
Returns:
the selected best state if any exists or a random successor.
See Also:
HillClimbingStrategy.select(extended.HillClimbing, java.util.List, java.lang.Object)