WeightedShortestProcessingTime) is defined as: h(j) = w[j] / p[j], where w[j] is the weight of job j, and p[j] is its processing time. However, for some scheduling cost functions, performance is improved if the heuristic is modified as follows. If the job j is already late (i.e., its due date d[j] < T, where T is the current time), then its heuristic value is: h(j) = w[j] / p[j], just like in the basic version. Otherwise, if the due date hasn't passed yet, then h(j) = 0. This implementation alters this definition slightly as: If job j is already late, then h(j) = max(
MIN_H, w[j] / p[j]), where
MIN_His a small non-zero value. If the job j is not yet late, then h(j) =
MIN_H. For deterministic construction of a schedule, this adjustment is unnecessary. However, for stochastic sampling algorithms it is important for the heuristic to return positive values.
Field SummaryModifier and TypeFieldDescription
static final doubleThe minimum heuristic value.
Method SummaryModifier and TypeMethodDescription
final intGets the required length of complete solutions to the problem instance for which this constructive heuristic is configured.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.
(int n)Creates an empty Partial solution, which will be incrementally transformed into a complete solution of a specified length.Gets a reference to the instance of the optimization problem that is the subject of this heuristic.
doubleHeuristically evaluates the possible addition of an element to the end of a Partial.
MIN_Hpublic static final double MIN_HThe minimum heuristic value. If the heuristic value as calculated is lower than MIN_H, then MIN_H is used as the heuristic value. The reason is related to the primary purpose of the constructive heuristics in the library: heuristic guidance for stochastic sampling algorithms, which assume positive heuristic values (e.g., an h of 0 would be problematic).
- See Also:
(SingleMachineSchedulingProblem problem)Constructs an WeightedShortestProcessingTimeLateOnly heuristic.
problem- The instance of a scheduling problem that is the target of the heuristic.
IllegalArgumentException- if problem.hasDueDates() returns false.
hHeuristically 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.
- Specified by:
p- The current state of the Partial
element- The element under consideration for adding to the Partial
incEval- An IncrementalEvaluation of p. This method assumes that incEval is of the same runtime type as the object returned by
- 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.
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
ConstructiveHeuristic.h(org.cicirello.search.ss.Partial<T>, int, org.cicirello.search.ss.IncrementalEvaluation<T>)method. The
ConstructiveHeuristic.h(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 the
ConstructiveHeuristic.h(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.
- An IncrementalEvaluation for an empty Partial
to be used for incrementally computing any data required by the
getProblemGets a reference to the instance of the optimization problem that is the subject of this heuristic.
createPartialCreates an empty Partial solution, which will be incrementally transformed into a complete solution of a specified length.
completeLengthpublic final int completeLength()Gets the required length of complete solutions to the problem instance for which this constructive heuristic is configured.