def spawn_worker(instance_id, port): res_x = 640 res_y = 480 # Set resolution from config if "Simulator" in P.get_current_parameters(): res_x = P.get_current_parameters()["Simulator"].get("window_x") or res_x res_y = P.get_current_parameters()["Simulator"].get("window_y") or res_y pos_x = (res_x + 20) * instance_id res_x = str(res_x) pos_x = str(pos_x) res_y = str(res_y) command = 'gnome-terminal -x ' + paths.get_sim_executable_path() + " -WINDOWED -ResX=" + res_x + " -ResY=" + res_y + \ " -FPS=10" + " -WinX=" + pos_x + " -WinY=50" command += " WorkerID " + str(instance_id) + " ApiServerPort " + str(port) subprocess.Popen(command, env=os.environ, shell=True)
def spawn_headless_worker(instance_id, port): print(f" . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' ") print(f" >>>>> Spawning a Headless Worker: {instance_id}") print(f" . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' . ' ") command = paths.get_sim_executable_path() + " WorkerID " + str(instance_id) + " ApiServerPort " + str(port) subprocess.Popen(command, env=os.environ, shell=True)
def spawn_headless_worker(instance_id, port): command = paths.get_sim_executable_path() + " WorkerID " + str( instance_id) + " ApiServerPort " + str(port) subprocess.Popen(command, env=os.environ, shell=True)