tycho-solver
Version:
Evolutionary computation and optimization library
11 lines (10 loc) • 500 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TieBreakerOperator = void 0;
const TieBreakerOperator = ({ currentSolution, neighbor, currentCost, neighborCost, maximizeCost, children }) => {
const isCostImprovement = (maximizeCost !== null && maximizeCost !== void 0 ? maximizeCost : false)
? neighborCost > currentCost
: neighborCost < currentCost;
return children(isCostImprovement);
};
exports.TieBreakerOperator = TieBreakerOperator;