예제 #1
0
    def eta(self, eta):
        if not (isinstance(eta, float) or isinstance(eta, int)):
            raise e.TypeError('`eta` should be a float or integer')
        if eta < 0:
            raise e.ValueError('`eta` should be >= 0')

        self._eta = eta
예제 #2
0
    def a(self, a):
        if not isinstance(a, (float, int)):
            raise e.TypeError('`a` should be a float or integer')
        if a < 0:
            raise e.ValueError('`a` should be >= 0')

        self._a = a
예제 #3
0
    def prunning_ratio(self, prunning_ratio):
        if not isinstance(prunning_ratio, (float, int)):
            raise e.TypeError('`prunning_ratio` should be a float or integer')
        if prunning_ratio < 0 or prunning_ratio > 1:
            raise e.ValueError('`prunning_ratio` should be between 0 and 1')

        self._prunning_ratio = prunning_ratio
예제 #4
0
    def positive_field(self, positive_field):
        if not isinstance(positive_field, (float, int)):
            raise e.TypeError('`positive_field` should be a float or integer')
        if positive_field < 0 or positive_field > 1:
            raise e.ValueError('`positive_field` should be between 0 and 1')

        self._positive_field = positive_field
예제 #5
0
    def n_trials(self, n_trials):
        if not isinstance(n_trials, int):
            raise e.TypeError('`n_trials` should be an integer')
        if n_trials <= 0:
            raise e.ValueError('`n_trials` should be > 0')

        self._n_trials = n_trials
예제 #6
0
파일: goa.py 프로젝트: ibrahim85/opytimizer
    def l(self, l):
        if not isinstance(l, (float, int)):
            raise e.TypeError('`l` should be a float or integer')
        if l < 0:
            raise e.ValueError('`l` should be >= 0')

        self._l = l
예제 #7
0
파일: goa.py 프로젝트: ibrahim85/opytimizer
    def c_max(self, c_max):
        if not isinstance(c_max, (float, int)):
            raise e.TypeError('`c_max` should be a float or integer')
        if c_max < self.c_min:
            raise e.ValueError('`c_max` should be >= `c_min`')

        self._c_max = c_max
예제 #8
0
    def bw_min(self, bw_min):
        if not isinstance(bw_min, (float, int)):
            raise e.TypeError('`bw_min` should be a float or integer')
        if bw_min < 0:
            raise e.ValueError('`bw_min` should be >= 0')

        self._bw_min = bw_min
예제 #9
0
    def PAR(self, PAR):
        if not isinstance(PAR, (float, int)):
            raise e.TypeError('`PAR` should be a float or integer')
        if PAR < 0 or PAR > 1:
            raise e.ValueError('`PAR` should be between 0 and 1')

        self._PAR = PAR
예제 #10
0
    def LP(self, LP):
        if not isinstance(LP, int):
            raise e.TypeError('`LP` should be a integer')
        if LP <= 0:
            raise e.ValueError('`LP` should be > 0')

        self._LP = LP
예제 #11
0
    def HMCR(self, HMCR):
        if not isinstance(HMCR, (float, int)):
            raise e.TypeError('`HMCR` should be a float or integer')
        if HMCR < 0 or HMCR > 1:
            raise e.ValueError('`HMCR` should be between 0 and 1')

        self._HMCR = HMCR
예제 #12
0
    def PAR_min(self, PAR_min):
        if not isinstance(PAR_min, (float, int)):
            raise e.TypeError('`PAR_min` should be a float or integer')
        if PAR_min < 0 or PAR_min > 1:
            raise e.ValueError('`PAR_min` should be between 0 and 1')

        self._PAR_min = PAR_min
예제 #13
0
    def bw(self, bw):
        if not isinstance(bw, (float, int)):
            raise e.TypeError('`bw` should be a float or integer')
        if bw < 0:
            raise e.ValueError('`bw` should be >= 0')

        self._bw = bw
예제 #14
0
    def p(self, p):
        if not (isinstance(p, float) or isinstance(p, int)):
            raise e.TypeError('`p` should be a float or integer')
        if p < 0 or p > 1:
            raise e.ValueError('`p` should be between 0 and 1')

        self._p = p
예제 #15
0
    def beta(self, beta):
        if not isinstance(beta, (float, int)):
            raise e.TypeError('`beta` should be a float or integer')
        if beta < 0:
            raise e.ValueError('`beta` should be >= 0')

        self._beta = beta
예제 #16
0
    def pm(self, pm):
        if not isinstance(pm, (float, int)):
            raise e.TypeError('`pm` should be a float or integer')
        if pm < 0 or pm > 1:
            raise e.ValueError('`pm` should be between 0 and 1')

        self._pm = pm
예제 #17
0
파일: goa.py 프로젝트: ibrahim85/opytimizer
    def f(self, f):
        if not isinstance(f, (float, int)):
            raise e.TypeError('`f` should be a float or integer')
        if f < 0:
            raise e.ValueError('`f` should be >= 0')

        self._f = f
예제 #18
0
    def min_depth(self, min_depth):
        if not isinstance(min_depth, int):
            raise e.TypeError('`min_depth` should be an integer')
        if min_depth <= 0:
            raise e.ValueError('`min_depth` should be > 0')

        self._min_depth = min_depth
예제 #19
0
파일: goa.py 프로젝트: ibrahim85/opytimizer
    def c_min(self, c_min):
        if not isinstance(c_min, (float, int)):
            raise e.TypeError('`c_min` should be a float or integer')
        if c_min < 0:
            raise e.ValueError('`c_min` should be >= 0')

        self._c_min = c_min
예제 #20
0
    def max_depth(self, max_depth):
        if not isinstance(max_depth, int):
            raise e.TypeError('`max_depth` should be an integer')
        if max_depth < self.min_depth:
            raise e.ValueError('`max_depth` should be >= `min_depth`')

        self._max_depth = max_depth
예제 #21
0
    def r_ratio(self, r_ratio):
        if not isinstance(r_ratio, (float, int)):
            raise e.TypeError('`r_ratio` should be a float or integer')
        if r_ratio < 0 or r_ratio > 1:
            raise e.ValueError('`r_ratio` should be between 0 and 1')

        self._r_ratio = r_ratio
예제 #22
0
    def k_max(self, k_max):
        if not isinstance(k_max, int):
            raise e.TypeError('`k_max` should be an integer')
        if k_max <= 0:
            raise e.ValueError('`k_max` should be > 0')

        self._k_max = k_max
예제 #23
0
파일: coa.py 프로젝트: Wkenwe/opytimizer
    def n_p(self, n_p):
        if not isinstance(n_p, int):
            raise e.TypeError('`n_p` should be an integer')
        if n_p <= 0:
            raise e.ValueError('`n_p` should be > 0')

        self._n_p = n_p
예제 #24
0
    def h_max(self, h_max):
        if not isinstance(h_max, int):
            raise e.TypeError('`h_max` should be an integer')
        if h_max <= 0:
            raise e.ValueError('`h_max` should be > 0')

        self._h_max = h_max
예제 #25
0
    def r_min(self, r_min):
        if not isinstance(r_min, (float, int)):
            raise e.TypeError('`r_min` should be a float or integer')
        if r_min < 0:
            raise e.ValueError('`r_min` should be >= 0')

        self._r_min = r_min
예제 #26
0
    def b(self, b):
        if not isinstance(b, (float, int)):
            raise e.TypeError('`b` should be a float or integer')
        if b < 0:
            raise e.ValueError('`b` should be >= 0')

        self._b = b
예제 #27
0
    def p_crossover(self, p_crossover):
        if not isinstance(p_crossover, (float, int)):
            raise e.TypeError('`p_crossover` should be a float or integer')
        if p_crossover < 0 or p_crossover > 1:
            raise e.ValueError('`p_crossover` should be between 0 and 1')

        self._p_crossover = p_crossover
예제 #28
0
    def gamma(self, gamma):
        if not isinstance(gamma, (float, int)):
            raise e.TypeError('`gamma` should be a float or integer')
        if gamma < 0:
            raise e.ValueError('`gamma` should be >= 0')

        self._gamma = gamma
예제 #29
0
    def p_reproduction(self, p_reproduction):
        if not isinstance(p_reproduction, (float, int)):
            raise e.TypeError('`p_reproduction` should be a float or integer')
        if p_reproduction < 0 or p_reproduction > 1:
            raise e.ValueError('`p_reproduction` should be between 0 and 1')

        self._p_reproduction = p_reproduction
예제 #30
0
    def clip_ratio(self, clip_ratio):
        if not isinstance(clip_ratio, (float, int)):
            raise e.TypeError('`clip_ratio` should be a float or integer')
        if clip_ratio < 0 or clip_ratio > 1:
            raise e.ValueError('`clip_ratio` should be between 0 and 1')

        self._clip_ratio = clip_ratio