Class RandomHeuristicFunction

All Implemented Interfaces:

public class RandomHeuristicFunction extends Object implements HeuristicFunction
This simply returns a random number between 0 and 1. The results may be different for each call on the same configuration - this may have unexpected consequences.
AO Industries, Inc.
  • Constructor Details

    • RandomHeuristicFunction

      public RandomHeuristicFunction()
  • 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
      clusterConfiguration - The ClusterConfiguration representing the current state.
      g - The number of moves already made.
      The estimated number of moves to an optimal state