MCPcopy Create free account
hub / github.com/Simple-Robotics/Simple / simulate_tau_batch_parallel

Function simulate_tau_batch_parallel

sandbox/parallel_rollout.py:93–107  ·  view source on GitHub ↗
(sim_batch, q, v, tau_batch, dt)

Source from the content-addressed store, hash-verified

91
92
93def simulate_tau_batch_parallel(sim_batch, q, v, tau_batch, dt):
94 def rollout_single(sim, tau):
95 q_ = q.copy()
96 v_ = v.copy()
97 sim.rollout(q_, v_, tau, dt) # rollout without GIL
98 return sim.qnew, sim.vnew
99
100 with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
101 futures = [
102 executor.submit(rollout_single, sim, tau)
103 for sim, tau in zip(sim_batch, tau_batch)
104 ]
105 results = [f.result() for f in futures]
106
107 return results
108
109
110# check if results match

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected