Added function info to decorators
This commit is contained in:
@ -1,3 +1,6 @@
|
|||||||
|
from EasyGA import function_info
|
||||||
|
|
||||||
|
@function_info
|
||||||
def _add_by_fitness_goal(termination_impl):
|
def _add_by_fitness_goal(termination_impl):
|
||||||
"""Adds termination by fitness goal to the method."""
|
"""Adds termination by fitness goal to the method."""
|
||||||
|
|
||||||
@ -25,10 +28,10 @@ def _add_by_fitness_goal(termination_impl):
|
|||||||
# Check other termination methods
|
# Check other termination methods
|
||||||
return termination_impl(ga)
|
return termination_impl(ga)
|
||||||
|
|
||||||
new_method.__name__ = termination_impl.__name__
|
|
||||||
return new_method
|
return new_method
|
||||||
|
|
||||||
|
|
||||||
|
@function_info
|
||||||
def _add_by_generation_goal(termination_impl):
|
def _add_by_generation_goal(termination_impl):
|
||||||
"""Adds termination by generation goal to the method."""
|
"""Adds termination by generation goal to the method."""
|
||||||
|
|
||||||
@ -41,10 +44,10 @@ def _add_by_generation_goal(termination_impl):
|
|||||||
# Check other termination methods
|
# Check other termination methods
|
||||||
return termination_impl(ga)
|
return termination_impl(ga)
|
||||||
|
|
||||||
new_method.__name__ = termination_impl.__name__
|
|
||||||
return new_method
|
return new_method
|
||||||
|
|
||||||
|
|
||||||
|
@function_info
|
||||||
def _add_by_tolerance_goal(termination_impl):
|
def _add_by_tolerance_goal(termination_impl):
|
||||||
"""Adds termination by tolerance goal to the method."""
|
"""Adds termination by tolerance goal to the method."""
|
||||||
|
|
||||||
@ -71,7 +74,6 @@ def _add_by_tolerance_goal(termination_impl):
|
|||||||
# Check other termination methods
|
# Check other termination methods
|
||||||
return termination_impl(ga)
|
return termination_impl(ga)
|
||||||
|
|
||||||
new_method.__name__ = termination_impl.__name__
|
|
||||||
return new_method
|
return new_method
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user