research: karman reproduce uses committed pinball ids after sync_bodies
add_body after initialize returns a pending negative id; sync_bodies commits the new bodies in order, so the pinball ids are n0..n0+2 (f2f88c phase3 did the same). Fixes the KeyError(-1) in the GPU smoke. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ded0c52975
commit
580397eaf8
@@ -76,9 +76,11 @@ def main():
|
||||
# Legacy build_karman_cloak order: stabilize disturbance + probes, then the
|
||||
# 150-interval zero-action target sampling (kept as flow time), then the pinball.
|
||||
sim.run(WARMUP + FIFO_LEN * SI)
|
||||
pinball = [sim.add_body("circle", center=c, radius=R)
|
||||
for c in ((30 * L0, YC, 0.0), (626.0, YC + 15, 0.0), (626.0, YC - 15, 0.0))]
|
||||
n0 = sim.bodies.count
|
||||
for c in ((30 * L0, YC, 0.0), (626.0, YC + 15, 0.0), (626.0, YC - 15, 0.0)):
|
||||
sim.add_body("circle", center=c, radius=R) # pending (negative) id until sync
|
||||
sim.sync_bodies()
|
||||
pinball = list(range(n0, n0 + 3)) # committed ids, as in f2f88c phase3
|
||||
sim.run(WARMUP)
|
||||
cells = float(len(sim.bodies.get(probes[0]).get_sensor_list(NX, NY)[0])) # probe sum = mean * cells
|
||||
|
||||
|
||||
Reference in New Issue
Block a user