Class ExponentialDeviationWithNoneHeuristicFunction
java.lang.Object
com.aoindustries.aoserv.cluster.optimize.ExponentialDeviationWithNoneHeuristicFunction
- All Implemented Interfaces:
ResultHandler<Object>,HeuristicFunction
public class ExponentialDeviationWithNoneHeuristicFunction
extends Object
implements HeuristicFunction, ResultHandler<Object>
Adds up all the non-optimal states of the analyzed cluster giving more weight
to higher level problems. Adds in
g*.00001 to prefer shorter paths. Each
type of problem is scaled by how far off the state is when possible.
The heuristics for "NONE" are also added (in negative form) with a coefficient of .001 (as a tie breaker with more weight than number of moves).
This is not thread safe.
The values are:
BASE = 1.5 NONE = 0.001 * deviation LOW = deviation MEDIUM = BASE * deviation HIGH = BASE*BASE * deviation CRITICAL = 1024 + BASE*BASE*BASE * deviation
- Author:
- AO Industries, Inc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetHeuristic(ClusterConfiguration clusterConfiguration, int g) Estimates the number of moves to an optimal state.booleanhandleResult(Result<?> result) Each result is provided as it is generated instead of building into lists.
-
Constructor Details
-
ExponentialDeviationWithNoneHeuristicFunction
public ExponentialDeviationWithNoneHeuristicFunction()
-
-
Method Details
-
getHeuristic
Description copied from interface:HeuristicFunctionEstimates the number of moves to an optimal state. If it uses the providedgg(n) it will result in Algorithm A. If it also always uses h(n) <= h*(n) it will result in Algorithm A*.- Specified by:
getHeuristicin interfaceHeuristicFunction- Parameters:
clusterConfiguration- TheClusterConfigurationrepresenting the current state.g- The number of moves already made.- Returns:
- The estimated number of moves to an optimal state
-
handleResult
Description copied from interface:ResultHandlerEach result is provided as it is generated instead of building into lists.- Specified by:
handleResultin interfaceResultHandler<Object>- Returns:
- true if more results are wanted, or false to receive no more results.
-
