Available Now
Book a demo and get early access. Free trial!
🤖 To simulate intelligent behaviors in robotics or digital twins, it helps to first understand the structure of a queueing system.
Most systems can be broken down into three core components:
Now imagine this:
What if your AI copilot could understand a prompt like:
"Place 5 drones in a queue, serve 1 every 10 seconds.
To make this possible, you need a setup where:
With this configuration, an AI copilot can take a plain-language instruction, understand what objects it needs to act on, and generate the appropriate Python code to build and run the simulation—no manual scripting required.
Let’s apply these concepts using simulation. Suppose you want to model a GI/G/1 queue—a single-server system with general (non-exponential) arrival and service distributions.
Together, they simulate a GI/G/1 queue—a single-server system with flexible interarrival and service time distributions—entirely agent-driven.
n8n Node Prompt:
{
"prompt": "Simulate a queue of 5 drones arriving randomly, served one by one"
}
This triggers a webhook that converts the prompt to parameters:
n_customers = 5
interarrival_dist = exponential
service_time = 10 sec
In this step, we’re using Python and the USD API to programmatically define a scene inside Isaac Sim. The arrival times are modeled using an exponential distribution to simulate realistic, stochastic input. This script creates the necessary structure in the USD stage so that Isaac Sim can later apply physics and visualize the drone behavior.
from pxr import Usd, UsdGeom, Sdf
import random
# Create a new USD stage
stage = Usd.Stage.CreateNew("queue_sim.usda")
# Root
UsdGeom.Xform.Define(stage, Sdf.Path("/World"))
# Spawn 5 drones at random arrival times
for i in range(5):
drone = UsdGeom.Xform.Define(stage, Sdf.Path(f"/World/Drone_{i}"))
arrival_time = random.expovariate(1/5) # λ=1/5
x = 0
y = i * -2 # queue position
z = 0
drone.AddTranslateOp().Set(value=(x, y, z))
stage.GetRootLayer().Save()
In this step, we define how each drone is "served" using Isaac Sim’s Drive API. The Drive API allows us to apply motion or force to specific parts of a USD prim—such as rotating a joint or moving a rigid body. We loop through each drone in the queue and apply a targetPosition
one at a time, introducing a delay (e.g., 10 seconds) between each to simulate sequential service. This mimics a real queue where only one unit is processed at a time by a single server.
from pxr import UsdPhysics
import omni
import asyncio
stage = omni.usd.get_context().get_stage()
async def serve_queue():
for i in range(5):
path = f"/World/Drone_{i}"
prim = stage.GetPrimAtPath(path)
if prim.IsValid():
print(f"Serving {path}")
drive = UsdPhysics.DriveAPI.Apply(prim, "linear")
drive.CreateTargetPositionAttr().Set((10, 0, 0)) # move forward
await asyncio.sleep(10) # simulate service time
asyncio.ensure_future(serve_queue())
This coroutine simulates drone service, one every 10 seconds, in FIFO order.
Your n8n canvas might look like:
[Prompt Node]
|
v
[Webhook] --> [Python Node: USD Gen] --> [Run Isaac Sim Container]
|
[Trigger serve_queue()]
This is what we call Agentic USD—USD prims and physics objects aren’t passive files anymore. They respond, simulate, and act—just like an agent.
Book a demo and get early access. Free trial!