
es.urjc.etsii.grafo.services.SolutionValidator Maven / Gradle / Ivy
package es.urjc.etsii.grafo.services;
import es.urjc.etsii.grafo.annotations.InheritedComponent;
import es.urjc.etsii.grafo.io.Instance;
import es.urjc.etsii.grafo.solution.Solution;
/**
* Solution validator: If implemented, validates the generated solutions from different algorithms
* during the execution, in order to detect bugs as soon as possible.
*
* @param Solution class
* @param Instance class
*/
@InheritedComponent
public abstract class SolutionValidator, I extends Instance> {
/**
* Validate the current solution, check that no constraint is broken and everything is fine
*
* @param solution Solution to validate
* @return ValidationResult.ok() if the solution is valid, ValidationResult.fail("reason why it failed") if a solution is not valid.
*/
public abstract ValidationResult validate(S solution);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy