osier.utils.apply_slack#
- osier.utils.apply_slack(pareto_front, slack, sense='minimize')[source]#
This function applies a specified slack value to a given Pareto front. Returns a
numpy.ndarraywith the same shape as the Pareto front.- Parameters:
pareto_front (
numpy.ndarray) – Anumpy.ndarraywith shape (population, N_objectives).slack (float or list of float) – The slack value for the sub-optimal front, expressed as a decimal percentage. If float is passed, the same slack will be applied to all objectives. A list of slack values should have the same length as the list of objectives. The slack will be applied to objective with the same index (defined when users initialized the
osier.CapacityExpansionproblem). Each slack value should be less than unity. If users that find a slack greater than unity desirable should consider rerunning the model with fewer or different objectives.sense (str) – Whether the objectives are maximized or minimized. Accepts [‘minimize’, ‘maximize’]. Default is “minimize.”
- Returns:
near_optimal_front – The near-optimal front.
- Return type: