Code Duplication    Length = 7-13 lines in 2 locations

NiaPy/algorithms/other/sa.py 1 location

@@ 87-99 (lines=13) @@
84
		"""
85
		return r"""None"""
86
87
	@staticmethod
88
	def typeParameters():
89
		r"""Get dictionary with functions for checking values of parameters.
90
91
		Returns:
92
			Dict[str, Callable]:
93
				* delta (Callable[[Union[float, int], bool]): TODO
94
		"""
95
		return {
96
			'delta': lambda x: isinstance(x, (int, float)) and x > 0,
97
			'T': lambda x: isinstance(x, (int, float)) and x > 0,
98
			'deltaT': lambda x: isinstance(x, (int, float)) and x > 0,
99
			'epsilon': lambda x: isinstance(x, float) and 0 < x < 1
100
		}
101
102
	def setParameters(self, delta=0.5, T=2000, deltaT=0.8, coolingMethod=coolDelta, epsilon=1e-23, **ukwargs):

NiaPy/algorithms/basic/fwa.py 1 location

@@ 156-162 (lines=7) @@
153
		"""
154
		return r"""Tan, Ying. "Firework Algorithm: A Novel Swarm Intelligence Optimization Method." (2015)."""
155
156
	@staticmethod
157
	def typeParameters(): return {
158
			'N': lambda x: isinstance(x, int) and x > 0,
159
			'm': lambda x: isinstance(x, int) and x > 0,
160
			'a': lambda x: isinstance(x, (int, float)) and x > 0,
161
			'b': lambda x: isinstance(x, (int, float)) and x > 0,
162
			'epsilon': lambda x: isinstance(x, float) and 0 < x < 1
163
	}
164
165
	def setParameters(self, N=40, m=40, a=1, b=2, A=40, epsilon=1e-31, **ukwargs):