public final class WeightedLongestProcessingTime extends Object
This is an implementation of the weighted longest process time heuristic. This heuristic is usually defined as choose the job j with smallest value of: h(j) = w[j] / p[j], where w[j] is the earliness weight of job j, and p[j] is its processing time. However, our constructive heuristic implementation, as well as our stochastic sampling implementations that rely on constructive heuristics assume that larger heuristic values are preferred. The stochastic sampling algorithms also assume that the heuristic's valuations are positive. So we redefine it as follows: h(j) = S - w[j] / p[j], where as before w[j] is the earliness weight of job j, and p[j] is its processing time. S is computed as: S =
MIN_H- min(w[j] / p[j]). The
MIN_His a small non-zero value. In this way, we shift all of the h(j) values by a constant amount such that all h(j) values are positive.
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.
(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.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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 a WeightedLongestProcessingTime heuristic.
problem- The instance of a scheduling problem that is the target of the heuristic.
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.
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.
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.