Exemple #1
0
 def stopCondE(self):
     # TODO add throwing exceptions for time and reference value
     dtime = datetime.now() - self.startTime
     if self.Evals >= self.nFES:
         raise FesException()
     elif self.Iters >= self.nGEN:
         raise GenException()
     elif self.runTime is not None and self.runTime >= dtime:
         raise TimeException()
     elif self.refValue != inf and self.refValue * self.optType.value >= self.x_f:
         raise RefException()
Exemple #2
0
    def stopCondE(self):
        r"""Throw exception for the given stopping condition.

		Raises:
			* FesException: Thrown when the number of function/fitness evaluations is reached.
			* GenException: Thrown when the number of algorithms generations/iterations is reached.
			* RefException: Thrown when the reference values is reached.
			* TimeException: Thrown when algorithm exceeds time run limit.
		"""
        # dtime = datetime.now() - self.startTime
        if self.Evals >= self.nFES: raise FesException()
        if self.Iters >= self.nGEN: raise GenException()
        # if self.runTime is not None and self.runTime >= dtime: raise TimeException()
        if self.refValue >= self.x_f: raise RefException()