示例#1
0
文件: space.py 项目: ajuji/opytimizer
    def best_agent(self, best_agent):
        if not isinstance(best_agent, Agent):
            raise e.TypeError('`best_agent` should be an Agent')

        self._best_agent = best_agent
示例#2
0
    def l(self, l):
        if not isinstance(l, (float, int)):
            raise e.TypeError('`l` should be a float or integer')

        self._l = l
示例#3
0
    def memory(self, memory: np.ndarray) -> None:
        if not isinstance(memory, np.ndarray):
            raise e.TypeError("`memory` should be a numpy array")

        self._memory = memory
示例#4
0
    def save_agents(self, save_agents: bool) -> None:
        if not isinstance(save_agents, bool):
            raise e.TypeError("`save_agents` should be a boolean")

        self._save_agents = save_agents
示例#5
0
    def life(self, life):
        if not isinstance(life, np.ndarray):
            raise e.TypeError('`life` should be a numpy array')

        self._life = life
示例#6
0
    def c1(self, c1: bool) -> None:
        if not isinstance(c1, bool):
            raise e.TypeError("`c1` should be a bool")

        self._c1 = c1
示例#7
0
    def velocity(self, velocity: np.ndarray) -> None:
        if not isinstance(velocity, np.ndarray):
            raise e.TypeError("`velocity` should be a numpy array")

        self._velocity = velocity
示例#8
0
    def pulse_rate(self, pulse_rate):
        if not isinstance(pulse_rate, np.ndarray):
            raise ex.TypeError('`pulse_rate` should be a numpy array')

        self._pulse_rate = pulse_rate
示例#9
0
    def pointer(self, pointer):
        if not callable(pointer):
            raise e.TypeError('`pointer` should be a callable')

        self._pointer = pointer
示例#10
0
    def velocity(self, velocity):
        if not isinstance(velocity, np.ndarray):
            raise ex.TypeError('`velocity` should be a numpy array')

        self._velocity = velocity
示例#11
0
    def loudness(self, loudness):
        if not isinstance(loudness, np.ndarray):
            raise ex.TypeError('`loudness` should be a numpy array')

        self._loudness = loudness
示例#12
0
    def frequency(self, frequency):
        if not isinstance(frequency, np.ndarray):
            raise ex.TypeError('`frequency` should be a numpy array')

        self._frequency = frequency
示例#13
0
    def S(self, S):
        if not isinstance(S, np.ndarray):
            raise e.TypeError('`S` should be a numpy array')

        self._S = S
示例#14
0
    def local_position(self, local_position):
        if not isinstance(local_position, np.ndarray):
            raise e.TypeError('`local_position` should be a numpy array')

        self._local_position = local_position
示例#15
0
    def TM(self, TM: List[Agent]) -> None:
        if not isinstance(TM, list):
            raise e.TypeError("`TM` should be a list")

        self._TM = TM
示例#16
0
    def name(self, name):
        if not isinstance(name, str):
            raise e.TypeError('`name` should be a string')

        self._name = name
示例#17
0
    def environment(self, environment: List[Agent]) -> None:
        if not isinstance(environment, list):
            raise e.TypeError("`environment` should be a list")

        self._environment = environment
示例#18
0
    def constraints(self, constraints):
        if not isinstance(constraints, list):
            raise e.TypeError('`constraints` should be a list')

        self._constraints = constraints
示例#19
0
    def c2(self, c2: bool) -> None:
        if not isinstance(c2, bool):
            raise e.TypeError("`c2` should be a bool")

        self._c2 = c2
示例#20
0
    def phi(self, phi):
        if not isinstance(phi, (float, int)):
            raise e.TypeError('`phi` should be a float or integer')

        self._phi = phi
示例#21
0
    def local_position(self, local_position: np.ndarray) -> None:
        if not isinstance(local_position, np.ndarray):
            raise e.TypeError("`local_position` should be a numpy array")

        self._local_position = local_position
示例#22
0
    def counter(self, counter: np.ndarray) -> None:
        if not isinstance(counter, np.ndarray):
            raise e.TypeError("`counter` should be a numpy array")

        self._counter = counter
示例#23
0
    def counter(self, counter):
        if not isinstance(counter, np.ndarray):
            raise e.TypeError('`counter` should be a numpy array')

        self._counter = counter
示例#24
0
    def life(self, life: np.ndarray) -> None:
        if not isinstance(life, np.ndarray):
            raise e.TypeError("`life` should be a numpy array")

        self._life = life
示例#25
0
    def f(self, f):
        if not isinstance(f, (float, int)):
            raise e.TypeError('`f` should be a float or integer')

        self._f = f
示例#26
0
    def name(self, name: str) -> None:
        if not isinstance(name, str):
            raise e.TypeError("`name` should be a string")

        self._name = name
示例#27
0
    def fl(self, fl: float) -> None:
        if not isinstance(fl, (float, int)):
            raise e.TypeError("`fl` should be a float or integer")

        self._fl = fl
示例#28
0
    def age(self, age):
        if not isinstance(age, list):
            raise e.TypeError('`age` should be a list')

        self._age = age
示例#29
0
    def functions(self, functions):
        if not isinstance(functions, list):
            raise e.TypeError('`functions` should be a list')

        self._functions = functions
示例#30
0
文件: space.py 项目: ajuji/opytimizer
    def agents(self, agents):
        if not isinstance(agents, list):
            raise e.TypeError('`agents` should be a list')

        self._agents = agents