if __name__ == "__main__":
pset = gp.PrimitiveSetTyped("MAIN", [x], bool)
pset.addEphemeralConstant("rand_int", lambda: random.randint(1, 10), int)
......
Which gives this error:
[2015-11-21 23:03:00,525] launcher INFO SCOOP 0.7 1.1 on linux using Python 3.4.3 (default, Oct 14 2015, 20:28:29) [GCC 4.8.4], API: 1013
[2015-11-21 23:03:00,525] launcher INFO Deploying 2 worker(s) over 1 host(s).
[2015-11-21 23:03:00,525] launcher INFO Worker distribution:
[2015-11-21 23:03:00,525] launcher INFO 127.0.0.1: 1 + origin
Started at 2015-11-21 23:03:01.914771
/usr/local/lib/python3.4/dist-packages/deap/creator.py:141: RuntimeWarning: A class named 'FitnessMax' has already been created and it will be overwritten. Consider deleting previous creation of that class or rename it.
RuntimeWarning)
/usr/local/lib/python3.4/dist-packages/deap/creator.py:141: RuntimeWarning: A class named 'Individual' has already been created and it will be overwritten. Consider deleting previous creation of that class or rename it.
RuntimeWarning)
[2015-11-21 23:03:01,992] scoopzmq (b'127.0.0.1:55560') ERROR An instance could not find its base reference on a worker. Ensure that your objects have their definition available in the root scope of your program.
Can't get attribute 'rand_int' on <module 'deap.gp' from '/usr/local/lib/python3.4/dist-packages/deap/gp.py'>
[2015-11-21 23:03:01,993] scoopzmq (b'127.0.0.1:53412') ERROR A worker exited unexpectedly. Read the worker logs for more information. SCOOP pool will now shutdown.
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/scoop/_comm/scoopzmq.py", line 188, in _recv
thisFuture = pickle.loads(msg[1])
AttributeError: Can't get attribute 'rand_int' on <module 'deap.gp' from '/usr/local/lib/python3.4/dist-packages/deap/gp.py'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.4/dist-packages/scoop/bootstrap/__main__.py", line 302, in <module>
b.main()
File "/usr/local/lib/python3.4/dist-packages/scoop/bootstrap/__main__.py", line 92, in main
self.run()
File "/usr/local/lib/python3.4/dist-packages/scoop/bootstrap/__main__.py", line 290, in run
futures_startup()
File "/usr/local/lib/python3.4/dist-packages/scoop/bootstrap/__main__.py", line 271, in futures_startup
run_name="__main__"
File "/usr/local/lib/python3.4/dist-packages/scoop/futures.py", line 64, in _startup
result = _controller.switch(rootFuture, *args, **kargs)
File "/usr/local/lib/python3.4/dist-packages/scoop/_control.py", line 207, in runController
future = execQueue.pop()
File "/usr/local/lib/python3.4/dist-packages/scoop/_types.py", line 320, in pop
self.updateQueue()
File "/usr/local/lib/python3.4/dist-packages/scoop/_types.py", line 343, in updateQueue
for future in self.socket.recvFuture():
File "/usr/local/lib/python3.4/dist-packages/scoop/_comm/scoopzmq.py", line 279, in recvFuture
received = self._recv()
File "/usr/local/lib/python3.4/dist-packages/scoop/_comm/scoopzmq.py", line 197, in _recv
raise ReferenceBroken(e)
scoop._comm.scoopexceptions.ReferenceBroken: Can't get attribute 'rand_int' on <module 'deap.gp' from '/usr/local/lib/python3.4/dist-packages/deap/gp.py'>
[2015-11-21 23:03:02,624] launcher (127.0.0.1:45690) INFO Root process is done.
[2015-11-21 23:03:02,625] launcher (127.0.0.1:45690) INFO Finished cleaning spawned subprocesses.
Process finished with exit code 0
Thanks in advance!
Anjum