Class RandomHeuristicFunction

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

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.
Author:
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
      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