Added function info to decorators

This commit is contained in:
SimpleArt
2020-12-29 19:33:46 -05:00
parent 5fc910fd17
commit 88161bd114

View File

@ -1,3 +1,6 @@
from EasyGA import function_info
@function_info
def _add_by_fitness_goal(termination_impl):
"""Adds termination by fitness goal to the method."""
@ -25,10 +28,10 @@ def _add_by_fitness_goal(termination_impl):
# Check other termination methods
return termination_impl(ga)
new_method.__name__ = termination_impl.__name__
return new_method
@function_info
def _add_by_generation_goal(termination_impl):
"""Adds termination by generation goal to the method."""
@ -41,10 +44,10 @@ def _add_by_generation_goal(termination_impl):
# Check other termination methods
return termination_impl(ga)
new_method.__name__ = termination_impl.__name__
return new_method
@function_info
def _add_by_tolerance_goal(termination_impl):
"""Adds termination by tolerance goal to the method."""
@ -71,7 +74,6 @@ def _add_by_tolerance_goal(termination_impl):
# Check other termination methods
return termination_impl(ga)
new_method.__name__ = termination_impl.__name__
return new_method