def startNewSim(self,simParam):
     self.stopSimulation()
     with self.lock:
         self.thread_exit = False
         self.isRunning = True
     self.worldBuffer = Queue.Queue()
     world = World(simParam)                                       #starts the world
     self.staticWorld = copy.deepcopy(world)               #static copy to merge and send to GUI
     self.worldBuffer.put((0,world.copyDynamicState()))    #puts dynamic state in the first spot
     self.simThread = threading.Thread(target=self.simulate, args=(world, 0, 1))   #runs the thread
     self.runTimeS = time.clock()
     self.simThread.start()
Exemple #2
0
 def startNewSim(self, simParam):
     self.stopSimulation()
     with self.lock:
         self.thread_exit = False
         self.isRunning = True
     self.worldBuffer = Queue.Queue()
     world = World(simParam)  #starts the world
     self.staticWorld = copy.deepcopy(
         world)  #static copy to merge and send to GUI
     self.worldBuffer.put(
         (0,
          world.copyDynamicState()))  #puts dynamic state in the first spot
     self.simThread = threading.Thread(target=self.simulate,
                                       args=(world, 0, 1))  #runs the thread
     self.runTimeS = time.clock()
     self.simThread.start()