Add parameter count adjustment for functions that are class methods
Hi, I am using PyGAD.GA inside of another class. The various functions PyGAD will accept as parameters have strict parameter count checks. However, when you assign a class method to these functions they get an extra "self" parameter assigned to them. PyGAD then interprets these extra self parameters as improperly constructed functions.
Using the "inspect" module I have added a check to see if an assigned function is actually a method. If so, it then adds one to the expected parameter count. This allows these methods to be used as contributing functions. This, in turn, permits more well-formatted object oriented code to be used when desired. Users can still assign non-class functions to these parameters and the code will accept them.
I am using this in my current experiments and it is working well.
Thanks for your time!
Mike