Interface ConstructiveHeuristic<T extends Copyable<T>>

 Type Parameters:
T
 The type of Partial object for which this ConstructiveHeuristic guides construction, which is assumed to be an object that is a sequence of integers (e.g., vector of integers, permutation, or some other indexable type that stores integers).
 All Known Implementing Classes:
ApparentTardinessCost
,ApparentTardinessCostSetupAdjusted
,ATCS
,DynamicATCS
,EarliestDueDate
,ExponentialEarlyTardyHeuristic
,HybridConstructiveHeuristic
,LinearEarlyTardyHeuristic
,MinimumSlackTime
,Montagne
,ShortestProcessingPlusSetupTime
,ShortestProcessingPlusSetupTimePrecompute
,ShortestProcessingTime
,SmallestNormalizedSetup
,SmallestSetup
,SmallestSetupPrecompute
,SmallestTwoJobSetup
,WeightedCostOverTime
,WeightedCostOverTimeSetupAdjusted
,WeightedCriticalRatio
,WeightedCriticalRatioSetupAdjusted
,WeightedLongestProcessingTime
,WeightedShortestProcessingPlusSetupTime
,WeightedShortestProcessingPlusSetupTimeLateOnly
,WeightedShortestProcessingPlusSetupTimePrecompute
,WeightedShortestProcessingTime
,WeightedShortestProcessingTimeLateOnly
public interface ConstructiveHeuristic<T extends Copyable<T>>
Classes implementing this interface are used as constructive heuristics for constructing heuristic solutions to optimization problems, as well as for certain stochastic sampling search algorithms.


Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
completeLength()
Gets the required length of complete solutions to the problem instance for which this constructive heuristic is configured.default IncrementalEvaluation<T>
createIncrementalEvaluation()
Creates an IncrementalEvaluation object corresponding to an initially empty Partial for use in incrementally constructing a solution to the problem for which this heuristic is designed.Partial<T>
createPartial(int n)
Creates an empty Partial solution, which will be incrementally transformed into a complete solution of a specified length.Problem<T>
getProblem()
Gets a reference to the instance of the optimization problem that is the subject of this heuristic.double
h(Partial<T> p, int element, IncrementalEvaluation<T> incEval)
Heuristically evaluates the possible addition of an element to the end of a Partial.



Method Detail

h
double h(Partial<T> p, int element, IncrementalEvaluation<T> incEval)
Heuristically evaluates the possible addition of an element to the end of a Partial. Higher evaluations imply that the element is a better choice for the next element to add. For example, if you evaluate two elements, x and y, with h, and h returns a higher value for y than for x, then this means that y is believed to be the better choice according to the heuristic. Implementations of this interface must ensure that h always returns a positive result. This is because stochastic sampling algorithms such as HBSS and VBSS assume that the constructive heuristic returns only positive values. Parameters:
p
 The current state of the Partialelement
 The element under consideration for adding to the PartialincEval
 An IncrementalEvaluation of p. This method assumes that incEval is of the same runtime type as the object returned bycreateIncrementalEvaluation()
. Returns:
 The heuristic evaluation of the hypothetical addition of element to the end of p. The higher the evaluation, the more important the heuristic believes that element should be added next. The intention is to compare the value returned with the heuristic evaluations of other elements. Individual results in isolation are not necessarily meaningful.
 Throws:
ClassCastException
 if incEval is not of the same runtime type as the objects returned by thecreateIncrementalEvaluation()
method of the class implementing this interface

createIncrementalEvaluation
default IncrementalEvaluation<T> createIncrementalEvaluation()
Creates an IncrementalEvaluation object corresponding to an initially empty Partial for use in incrementally constructing a solution to the problem for which this heuristic is designed. The object returned incrementally computes any data associated with a Partial as needed by the
h(org.cicirello.search.ss.Partial<T>, int, org.cicirello.search.ss.IncrementalEvaluation<T>)
method. Theh(org.cicirello.search.ss.Partial<T>, int, org.cicirello.search.ss.IncrementalEvaluation<T>)
method will assume that it will be given an object of the specific runtime type returned by this method. It is unsafe to pass IncrementalEvaluation objects created by one heuristic to theh(org.cicirello.search.ss.Partial<T>, int, org.cicirello.search.ss.IncrementalEvaluation<T>)
method of another.The default implementation simply returns null, which is appropriate for heuristics that won't benefit from incrementally computing heuristic information.
 Returns:
 An IncrementalEvaluation for an empty Partial
to be used for incrementally computing any data required by the
h(org.cicirello.search.ss.Partial<T>, int, org.cicirello.search.ss.IncrementalEvaluation<T>)
method.

createPartial
Partial<T> createPartial(int n)
Creates an empty Partial solution, which will be incrementally transformed into a complete solution of a specified length. Parameters:
n
 the desired length of the final complete solution. Returns:
 an empty Partial solution

completeLength
int completeLength()
Gets the required length of complete solutions to the problem instance for which this constructive heuristic is configured. Returns:
 length of solutions to the problem instance for which this heuristic is configured

