public interface PenalizingValidation extends Validation
Interface of a validation produced by a penalizing constraint. Extends the main Validation
interface with an additional method getPenalty()
to access the assigned penalty. A predefined
simple implementation is provided that wraps a boolean and double value reflecting whether the solution
passed validation and the assigned penalty (see SimplePenalizingValidation
).
When implementing custom delta validations, the validation of the current solution of a neighbourhood search is passed back to the problem to validate a move. Knowing only whether the current solution passed validation and which penalty had been assigned might not be sufficient to efficiently validate the modified solution. In such case, custom penalizing validation objects can be designed that keep track of any additional metadata used for efficient delta validation.
Modifier and Type | Method and Description |
---|---|
double |
getPenalty()
Get the assigned penalty.
|
passed
double getPenalty()
Validation.passed()
returns true
, and a positive double value
if the solution did not pass validation.Copyright © 2016. All rights reserved.