unilab.base.entity.SceneTensorReadPlan¶
- class unilab.base.entity.SceneTensorReadPlan[source]¶
Bases:
objectPhase-scoped packed tensor reads for one
EntityScene.The plan is the Manager read boundary. A phase calls
refresh()(orrefresh_selected()after a mask reset) once and then slices entity views from the resulting packet. Host-bridge execution therefore performs one packed H2D transfer per read phase regardless of the number of terms, entities, sensors, or bodies.- Parameters:
Methods
__init__(*, scene, device, entities, ...)body_tensor_view(entity[, body_names])Return entity-local body state from canonical phase sensors.
close()Release the backend-owned packed read plan.
Drop phase values after an in-phase simulation mutation.
joint_tensor_view(entity)Return one entity's validated joint state from the phase packet.
refresh()Publish one full-batch packet for the current read phase.
Publish the post-selected-reset packet for the current read phase.
sensor_tensor_views(entity, names)Return explicit named sensors from the phase packet.
Attributes
Return the immutable backend sensor names compiled into this plan.
Return whether the current packet is available to phase readers.
- property scene: EntityScene¶
- property packet_names: tuple[str, ...]¶
Return the immutable backend sensor names compiled into this plan.
- refresh_selected()[source]¶
Publish the post-selected-reset packet for the current read phase.
Host bridges use the backend’s selected-row boundary so reset rebuild does not trigger a second full read. Device-resident backends refresh their stable public views through the same normal read path.
- Return type:
- joint_tensor_view(entity)[source]¶
Return one entity’s validated joint state from the phase packet.
- Parameters:
- Return type:
- sensor_tensor_views(entity, names)[source]¶
Return explicit named sensors from the phase packet.
- Parameters:
- Return type: