Skip to content

Add arbitrary size function keyword arg to selDoubleTournament #306

Open
edwardclem wants to merge 1 commit intoDEAP:masterfrom
edwardclem:master
Open

Add arbitrary size function keyword arg to selDoubleTournament #306
edwardclem wants to merge 1 commit intoDEAP:masterfrom
edwardclem:master

Conversation

@edwardclem
Copy link

Hi all,

To improve code readability and interoperability with non-list-derived individuals, I've added a size kwarg to tools.selDoubleTournament that allows the user to supply a "size" function aside from the default len, analogous to the key parameter in built-in sorting functions.

I've been using DEAP with individuals lacking a built-in __len__ function. Instead, these individuals have several properties that may be useful proxies for "size," which are calculated by an external library rather than being properties of the objects themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant