Smashed bug with thread

This commit is contained in:
Dominik Moritz Roth 2022-04-15 19:16:00 +02:00
parent 9a187cc3ed
commit 7217bc04b3
3 changed files with 5 additions and 3 deletions

Binary file not shown.

View File

@ -197,7 +197,7 @@ def humanVsAi(train=True, remember=True):
trainer.trainFromTerm(run.head)
print('[!] I have become smart! Destroyer of human Ultimate-TicTacToe players! (Neuristic update completed)')
if remember:
trainer.saveToMemoryBank(term)
trainer.saveToMemoryBank(run.head)
print('[!] Your cognitive and strategic destinctiveness was added to my own! (Game inserted into memoryBank)')
print('[!] This marks the beginning of the end of humankind!')
print('[i] Thanks for playing! Goodbye...')

View File

@ -151,7 +151,7 @@ class QueueingUniverse(Universe):
try:
yield self.pq.get(False).data
except Empty:
time.sleep(1)
return None
def activateEdge(self, head):
head._activateEdge()
@ -379,13 +379,15 @@ class Worker():
def runLocal(self):
for i, node in enumerate(self.universe.iter()):
if node==None:
time.sleep(1)
if not self._alive:
return
node.decayEvent()
def kill(self):
self._alive = False
self.thread.join()
self.thread.join(15)
def revive(self):
self._alive = True