platypus.filters module
- platypus.filters.feasible(solutions)
Filters out any infeasible solutions, returninig only feasible solutions.
Parameters
- solutionsiterable of Solution
The solutions to filter.
- platypus.filters.group(solutions, key=<function objectives_key>)
Groups solutions by the given key.
Returns a mapping from each unique key to a list of solutions with that key value.
Parameters
- solutionsiterable
The collection of solutions being grouped.
- keycallable
Returns the key used for grouping, where solutions with identical values are grouped together.
- platypus.filters.infeasible(solutions)
Filters out any feasible solutions, returning only infeasible solutions.
Parameters
- solutionsiterable of Solution
The solutions to filter.
- platypus.filters.matches(solutions, value, key=<function objectives_key>)
Returns only those solutions matching the given value.
Parameters
- solutionsiterable
The collectioin of solutions being filtered.
- valueobject
The value being matched.
- keycallable
Returns the key used for filtering.
- platypus.filters.truncate(solutions, size, key=<function objectives_key>, reverse=False)
Truncates the population down to the given size.
Parameters
- solutionsiterable
The collection of solutions being truncated.
- sizeint
The number of solutions to return.
- keycallable
Returns the key used for truncation.
- reversebool
If True, reverse the ordering to truncate the smallest keys first.