Class LeastInformedHeuristicFunction

java.lang.Object
com.aoindustries.aoserv.cluster.optimize.LeastInformedHeuristicFunction
All Implemented Interfaces:
HeuristicFunction

public class LeastInformedHeuristicFunction extends Object implements HeuristicFunction
This simply returns g if the cluster is optimal or g+1 if it is optimal.
Author:
AO Industries, Inc.
  • Constructor Details

    • LeastInformedHeuristicFunction

      public LeastInformedHeuristicFunction()
  • Method Details

    • getHeuristic

      public double getHeuristic(ClusterConfiguration clusterConfiguration, int g)
      Description copied from interface: HeuristicFunction
      Estimates the number of moves to an optimal state. If it uses the provided g g(n) it will result in Algorithm A. If it also always uses h(n) <= h*(n) it will result in Algorithm A*.
      Specified by:
      getHeuristic in interface HeuristicFunction
      Parameters:
      clusterConfiguration - The ClusterConfiguration representing the current state.
      g - The number of moves already made.
      Returns:
      The estimated number of moves to an optimal state