Esempio n. 1
0
 def __init__(self, **kwargs):
     task, x, rho = kwargs.get('task', None), kwargs.get('x',
                                                         None), kwargs.get(
                                                             'rho', 1)
     if rho != None: self.rho = rho
     elif task != None or x != None: self.rho = 1.0
     Individual.__init__(self, **kwargs)
Esempio n. 2
0
File: abc.py Progetto: sisco0/NiaPy
    def __init__(self, **kargs):
        r"""Initialize individual.

		Args:
			kargs (Dict[str, Any]): Additional arguments.

		See Also:
			* :func:`NiaPy.algorithms.Individual.__init__`
		"""
        Individual.__init__(self, **kargs)
Esempio n. 3
0
    def __init__(self, **kwargs):
        r"""Init Aging Individual.

		Args:
			**kwargs (Dict[str, Any]): Additional arguments sent to parent.

		See Also:
			* :func:`NiaPy.algorithms.Individual.__init__`
		"""
        Individual.__init__(self, **kwargs)
        self.age = 0
Esempio n. 4
0
File: mke.py Progetto: zyumons/NiaPy
	def __init__(self, **kwargs):
		r"""Initialize Monkey particle.

		Args:
			**kwargs: Additional arguments

		See Also:
			* :class:`NiaPy.algorithms.Individual.__init__()`
		"""
		Individual.__init__(self, **kwargs)
		self.f_pb, self.x_pb = self.f, self.x
		self.MonkeyKing = False
Esempio n. 5
0
    def __init__(self, F=2, CR=0.5, **kwargs):
        r"""Initialize SolutionjDE.

		Attributes:
			F (float): Scale factor.
			CR (float): Crossover probability.

		See Also:
			:func:`NiaPy.algorithm.Individual.__init__`
		"""
        Individual.__init__(self, **kwargs)
        self.F, self.CR = F, CR
Esempio n. 6
0
	def __init__(self, **kwargs):
		r"""Initialize individual.

		Args:
			kwargs (Dict[str, Any]): Additional arguments.

		See Also:
			* :func:`NiaPy.algorithms.Individual.__init__`
		"""
		Individual.__init__(self, **kwargs)
		task, x, rho = kwargs.get('task', None), kwargs.get('x', None), kwargs.get('rho', 1)
		if rho != None: self.rho = rho
		elif task != None or x != None: self.rho = 1.0
Esempio n. 7
0
    def __init__(self, weight, **kwargs):
        r"""Initialize fish individual.

		Args:
			weight (float): Weight of fish.
			**kwargs (Dict[str, Any]): Additional arguments.

		See Also:
			* :func:`NiaPy.algorithms.algorithm.Individual`
		"""
        Individual.__init__(self, **kwargs)
        self.weight = weight
        self.delta_pos = nan
        self.delta_cost = nan
        self.has_improved = False
Esempio n. 8
0
File: ca.py Progetto: sisco0/NiaPy
    def __init__(self, E_init=None, S_init=None, **kwargs):
        r"""Initialize the Camel.

		Args:
			E_init (Optional[float]): Starting endurance of Camel.
			S_init (Optional[float]): Stating supply of Camel.
			**kwargs (Dict[str, Any]): Additional arguments.

		See Also:
			* :func:`NiaPy.algorithms.Individual.__init__`
		"""
        Individual.__init__(self, **kwargs)
        self.E, self.E_past = E_init, E_init
        self.S, self.S_past = S_init, S_init
        self.x_past, self.f_past = self.x, self.f
        self.steps = 0
Esempio n. 9
0
	def __init__(self, SR=None, grade=0, enable=True, improved=False, task=None, **kwargs):
		r"""Initialize the individual.

		Args:
			SR (numpy.ndarray): Search range.
			grade (Optional[int]): Grade of individual.
			enable (Optional[bool]): If enabled individual.
			improved (Optional[bool]): If individual improved.
			**kwargs (Dict[str, Any]): Additional arguments.

		See Also:
			:func:`NiaPy.algorithms.algorithm.Individual.__init__`
		"""
		Individual.__init__(self, task=task, **kwargs)
		self.grade, self.enable, self.improved = grade, enable, improved
		if SR is None and task is not None: self.SR = task.bRange / 4
		else: self.SR = SR
Esempio n. 10
0
 def __init__(self, **kwargs):
     Individual.__init__(self, **kwargs)
     self.f_pb, self.x_pb = self.f, self.x
     self.MonkeyKing = False
Esempio n. 11
0
File: jde.py Progetto: tuahk/NiaPy
	def __init__(self, **kwargs):
		Individual.__init__(self, **kwargs)
		self.F, self.CR = kwargs.get('F', 2), kwargs.get('CR', 0.5)
Esempio n. 12
0
 def __init__(self, task, rand):
     Individual.__init__(self, task=task, e=False, rand=rand)
Esempio n. 13
0
 def __init__(self, task):
     Individual.__init__(self, task=task, e=False)
Esempio n. 14
0
	def __init__(self, **kwargs):
		Individual.__init__(self, **kwargs)
		self.age = 0
Esempio n. 15
0
 def __init__(self, weight, **kwargs):
     Individual.__init__(self, **kwargs)
     self.weight = weight
     self.delta_pos = np.nan
     self.delta_cost = np.nan
     self.has_improved = False
Esempio n. 16
0
 def __init__(self, SR, grade=0, enable=True, improved=False, **kwargs):
     Individual.__init__(self, **kwargs)
     self.SR, self.grade, self.enable, self.improved = SR, grade, enable, improved