Traffic¶
Requests is what the policy hands to the network in one control step. Every engine's submit(t, requests) takes it, or a bare send tensor, which is the same as Requests(send).
from isaac_net import Requests
send = torch.zeros(E, R, dtype=torch.long) # 0 = nothing
send[:, 0] = 1 # robot 0 of every env sends a class-1 message
send[:, 1] = 2 # robot 1 sends a class-2 message
net.submit(None, Requests(send))
The class index selects the message size: class c has NRConfig.msg_sizes[c - 1] bytes, 4,000 and 30,000 bytes by default. At most one message per robot enters the queue per control step, and it is refused (the accepted mask returned by submit is False) when the robot's buffer of NRConfig.frame_buffer messages is full.
The optional det and hid fields carry one application event per environment through the network. det[e, r] = True marks a message that carries the environment's current event, for example a camera frame that captured a hazard, and hid[e] is that event's id. step then returns det_env [E], which is True when a message carrying the current event id was delivered in that step. The Isaac layer exposes the same mechanism as a per-message tag (see Isaac Lab layer).
Traffic models¶
On level L2, NRConfig(traffic=[...]) adds generators that run inside the engine step, next to the policy's submit(): TrafficModel.periodic (periods may be shorter than the control step), .bursty (Markov on/off), .video (I/P frame pattern), .event (task triggers through step(..., triggers=)) and .policy(). Each generated message carries an arrival slot inside the step, and its delay counts from that slot. Every other level refuses traffic models with a ValueError. The configurability guide explains the models, the arrival offsets and the limits.
from isaac_net.core.traffic import TrafficModel as TM
cfg = NRConfig(traffic=[TM.periodic(200, period_ms=10).on(range(4)), TM.event(4000, trigger="alarm")])
net = make_engine("L2", E, R, "cuda", cfg, seed=0)
out = net.step(None, poses, triggers={"alarm": alarm_mask})
TrafficModel
dataclass
¶
TrafficModel(kind: str, size_bytes: float = 0.0, period_ms: float = 0.0, jitter_ms: float = 0.0, phase: str = 'random', rate_hz: float = 0.0, burst_size: int = 1, on_off: tuple = (1.0, 0.0), gop: Optional[tuple] = None, trigger: Union[str, Callable, None] = None, det: bool = False, robots: Optional[tuple] = None, tag: Optional[int] = None, priority: int = 0, deadline_ms: float = math.inf, max_msgs_per_step: Optional[int] = None, direction: str = 'ul')
One traffic generator. Build it with the constructors below, never directly.
Common optional extras (every constructor): tag (int, carried by the queue and reported per message; default
= 1 + the model's position in NRConfig.traffic, 0 is the policy's), priority (int, carried and reported; the
message class of NRConfig(scheduler="qos"), the other schedulers serve each robot FIFO), deadline_ms (reported
as deadline_miss; inf = none), max_msgs_per_step (the fixed number of arrivals per robot per step the model
reserves; more arrivals than that are deferred to the next step, never dropped, and counted in
TrafficGen.deferred), direction ("ul", the default, or "dl": the messages go to the robot's downlink queue; see
downlink()).
periodic
staticmethod
¶
A message of size_bytes every period_ms (telemetry, control loops); the period may be shorter than the
control step. phase "random": each robot's first message at a uniform time in [0, period) after a reset;
"aligned": at 0 for every robot. jitter_ms: each message is late by a uniform [0, jitter_ms) draw around
its nominal time (no drift; jitter_ms \< period_ms keeps the order).
bursty
staticmethod
¶
Markov on/off source: ON and OFF periods are exponential with means on_off = (mean_on_s, mean_off_s);
while ON, bursts arrive as a Poisson process of rate_hz, and each burst is burst_size messages of
size_bytes arriving together. mean_off_s = 0 gives an always-on Poisson burst source.
video
staticmethod
¶
One frame every 1000 / fps ms. gop = (I_bytes, P_bytes, gop_len): frame k of a robot (k counted from
its reset) is an I frame of I_bytes when k % gop_len == 0, else a P frame of P_bytes. Without gop every
frame is mean_frame_bytes. With both, the I and P sizes are scaled so that their mean is mean_frame_bytes
(gop then only fixes the I:P ratio).
event
staticmethod
¶
One message of size_bytes at the start of every step in which the robot's trigger is set. trigger: a
name looked up in engine.step(..., triggers={name: mask}) (a mask [E,R] or [E] bool, or a tensor passed
as triggers= directly, which then feeds every event model), or a callable f(clock [E]) -> mask. det=True
marks the message as carrying the env's current task event (det / hid, like Requests.det).
policy
staticmethod
¶
The policy's own messages through submit() (always on; listing it only documents the mix).
on
¶
The same model restricted to these robot indices (int, sequence, or None = all robots).
downlink
¶
The same model as a downlink source (direction="dl"): the gNB sends its messages to the robot.
max_per_step
¶
Arrivals per robot per control step the model reserves (fixed tensor width).
Requests
dataclass
¶
Messages each robot enqueues in one control step.
send: [E,R] long, 0 = nothing, c >= 1 = one message of traffic class c (size sizes[c-1]).
det: [E,R] bool, the message carries a detection of the env's current hazard (task payload, optional).
hid: [E] long, hazard id the detection refers to (optional).