neuroevolution-ai / NeuroEvolution-CTRNN_new

MIT License
3 stars 3 forks source link

Remove creator calls #48

Closed pdeubel closed 3 years ago

pdeubel commented 3 years ago

Removes calls to creator.create(), the resulting classes are implemented directly like shown in the documentation of DEAP.

One question is if a variable is a class variable or an instance variable. In DEAP they make everything as class variables except objects which are of instance type as seen in this code from deap.creator.create():

        if isinstance(obj, type):
            dict_inst[obj_name] = obj
        else:
            dict_cls[obj_name] = obj

I made the classes accordingly.

Closes #33.

bjuergens commented 3 years ago

ich liebe solche PRs. Da wird eine Sache aufgeräumt, und dann kaskadiert es durch das ganze Projekt und überall sinkt die Code-Komplexität.

bjuergens commented 3 years ago

Kann von mir aus gemergt werden.

Man könnte vllt. noch überlegen, ob es noch weitere Stellen gibt, die dadurch vereinfacht werden können. Aber das kann man von mir aus später machen, wenn man sowieso über solche Stellen stolpert.

der vollständigkeit wegen referenziere ich mal ein paar issues, die vielleicht von diesem PR vereinfacht werden könnten: #34 #36

pdeubel commented 3 years ago

Ja die würde ich in nem anderen PR machen