@zfunction/genetics-js
Version:
Genetic and evolutionary algorithms framework for the web
22 lines • 905 B
JavaScript
;
/*
* @license
* Copyright (c) 2019 Cristian Abrante. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var BaseSelection = /** @class */ (function () {
function BaseSelection() {
}
BaseSelection.prototype.checkParams = function (population, params) {
if (params.selectionCount < 0) {
throw new Error("Selection: negative value " + params.selectionCount + " is invalid for selection count.");
}
if (params.selectionCount > population.getPopulationSize()) {
throw new Error('Selection: could not select more individuals than elements in population');
}
};
return BaseSelection;
}());
exports.BaseSelection = BaseSelection;
//# sourceMappingURL=BaseSelection.js.map