t5lab.rollout¶
rollout
¶
Isolated rollout: one episode under (T5Actor). Mirrors ctde_v0's _single_rollout
structure but the L1 move comes from MVProp, not _goal_to_move.
Reuses ctde_v0 read-only: kb_adjacency, make_stencil, _navfield_blocked, goal_targets, compose_reward. Zero ctde_v0 edits.
Phase-1a scope: goal-offset PG action + MVProp move PG action; no selector / roles / difference-credit / dual. Contracts verified against ctde_v0 (comm-coverage env): env.reset(key) -> (obs (N,C,H,W), state) env.step(state, move, key) -> (obs, state, rew, done, info); info["reward_terms"] dict compose_reward(terms, world, cfg) -> (N,) per-agent reward; team = mean horizon = cfg.world.horizon (=100)
resolve_conflicts
¶
resolve_conflicts(moves, targets)
Priority-based collision resolver (self-contained; no ctde_v0 dependency, since the two run-boxes' ctde_v0 clones differ). moves (N,), targets (N,A,2) = the cell each action lands on. Process agents in index order: an agent keeps its move unless its target cell was already claimed by a lower-index agent this step, in which case it STAYs (action 0). Guarantees no two agents share a cell after the step (STAY lands on the agent's own, distinct, cell).
Source code in experiments/t5lab/rollout.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
greedy_toward
¶
greedy_toward(pos, goal)
(N,) deterministic action that most reduces Chebyshev distance to the goal — the NO-PLANNER control (drops MVProp). On open terrain this is optimal navigation.
Source code in experiments/t5lab/rollout.py
45 46 47 48 49 50 | |
rollout
¶
rollout(env, actor, cfg, key, stencil=None, controller='mvprop')
One fixed-length episode (cfg.world.horizon steps). Returns a trajectory pytree. controller: "mvprop" (learned planner, move is a PG action) or "greedy" (deterministic step-toward-goal, goal is the only PG action) — the no-planner control.
Source code in experiments/t5lab/rollout.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |