@syntest/search
Version:
The common core of the SynTest Framework
23 lines • 624 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LengthObjectiveComparator = void 0;
/**
* Secondary objective that is based on the length of the encoding.
*
* @author Mitchell Olsthoorn
*/
class LengthObjectiveComparator {
/**
* @inheritDoc
*/
compare(a, b) {
if (a.getLength() < b.getLength())
return -1;
if (a.getLength() > b.getLength())
return 1;
// Length must be equal
return 0;
}
}
exports.LengthObjectiveComparator = LengthObjectiveComparator;
//# sourceMappingURL=LengthObjectiveComparator.js.map