How Python Is Evolving Physics Simulation

June 12, 2025

In the early days of discrete-event simulation, we wrote everything by hand. Tools like simlib—a C-based simulation library—taught us how to manage event queues, model delays, and accumulate stats. But they also taught us something more valuable: Simulation is about control over time, behavior, and outcomes.

Today, that control still matters—but it doesn’t have to come from manual coding. With Python, USD, and AI copilots like those built into Champion, engineers are shifting from low-level scripting to high-level orchestration.

⚙️ Classic simlib: Functions That Defined Simulation Control

Let’s take a quick look at the essential simlib functions and what they did:

| `simlib` Function              | Purpose                                                     |
|-------------------------------|-------------------------------------------------------------|
| `init_simlib()`               | Initializes simulation, clock, lists, and metadata          |
| `list_file(option, list)`     | Inserts a record into a list (e.g., a queue or event list)  |
| `list_remove(option, list)`   | Removes a record from a list into a transfer array          |
| `timing()`                    | Advances sim time and gets next event type                  |
| `event_schedule(t, type)`     | Schedules a new event into the future                       |
| `event_cancel(type)`         | Cancels a pending event of given type                       |
| `sampst(val, var)`           | Samples discrete-time values (e.g., delay time)             |
| `timest(val, var)`           | Samples continuous-time values (e.g., number in queue)      |
| `filest(list)`               | Tracks average # of records in a list over time             |
| `expon(mean, stream)`        | Samples from an exponential distribution                    |
| `random_integer(p[], s)`     | Samples from a discrete distribution                        |

🐍 Python Equivalent: Clearer, Safer, Faster

Python (especially with SimPy, heapq, and asyncio) makes these ideas simpler, cleaner, and reusable. Here's a mapping:

| simlib Concept     | Python Equivalent                                             |
|--------------------|---------------------------------------------------------------|
| Event list         | `heapq` or `queue.PriorityQueue`                              |
| Transfer array     | Plain Python `dict` or object                                 |
| Timing function    | `simpy.Environment().timeout()` or `asyncio.sleep()`          |
| Distributions      | `numpy.random.exponential()`, `random.choices()`              |
| Stats accumulators | `pandas.DataFrame`, custom loggers                            |

Python Example:

import heapq
import random

sim_time = 0
event_list = []

def schedule_event(time, event_type):
    heapq.heappush(event_list, (time, event_type))

def run_simulation():
    global sim_time
    while event_list:
        sim_time, event_type = heapq.heappop(event_list)
        handle_event(event_type)

def handle_event(event_type):
    print(f"[{sim_time:.2f}] Handling event type {event_type}")

🤖 How Champion Automates These with Agentic AI

In Champion, we’ve taken the foundations of simlib—and rebuilt them for simulation engineers working with:

  • Physics engines like NVIDIA Isaac Sim
  • 3D CAD data in USD format
  • Procedural scene generation and time-based behavior

But instead of writing list_file() or event_schedule() manually, you simply tell the AI what you want to happen.

Prompt: “Place 3 boxes on the belt every 2 seconds. Remove them after they reach the edge.”

Here’s how Champion breaks this down internally using AI and USD structure awareness:

| Classical simlib Concept         | Champion's Agentic AI Equivalent                                   |
|----------------------------------|---------------------------------------------------------------------|
| `list_file(INCREASING)`          | Auto-generates `AddPrim` and `SetTransform` in USD                 |
| `event_schedule(t, type)`        | Schedules `Omni.timeline.schedule_task()` via Python API           |
| `timing()`                       | Internally handled by Omniverse's real-time loop                   |
| `transfer[]`                     | Internal memory passed between AI agents                           |
| `sampst()` and `timest()`        | Automatically tracked via sensors and AI logging agents            |

🛠️ Behind the Scenes: Champion Runtime Flow

  1. CAD file imported as USD
  2. Scene parsed into a graph (agents inspect paths, metadata, constraints)
  3. AI parses user prompt (intent like "repeat", "spawn", "follow", etc.)
  4. Champion generates Python scripts using omni.isaac, omni.usd, or carb.timeline
  5. Simulation runs with:
    • Events scheduled
    • Objects transformed
    • Collisions and physics applied
  6. Metrics logged to compare different runs (training data, validations, behaviors)

All of this used to be done manually in simlib using init_simlib, timing, event_schedule, and sampst. Now, it’s driven by language → logic → Python → USD.

Simlib vs Champion Function Mapping

Here's a side-by-side table comparing core simlib functions with their equivalents in Champion's agentic AI system.

| #  | `simlib` Function              | Champion Agentic Equivalent                                          |
|----|-------------------------------|----------------------------------------------------------------------|
| 1  | `init_simlib()`               | USD scene parsing + sim init agent                                   |
| 2  | `list_file(option, list)`     | AI places USD prims with spatial logic                               |
| 3  | `list_remove(option, list)`   | AI removes prims or toggles visibility                               |
| 4  | `timing()`                    | Handled by internal sim clock                                        |
| 5  | `event_schedule(time, type)`  | AI auto-schedules via prompt intent                                  |
| 6  | `event_cancel(type)`          | AI deletes/overrides scheduled actions                               |
| 7  | `sampst(value, var)`          | Auto-logged delay metrics via sensors                                |
| 8  | `timest(value, var)`          | Auto-logged continuous stats via USD agents                          |
| 9  | `filest(list)`                | Tracked object count via USD timeline hooks                          |
| 10 | `expon(mean, stream)`         | Sampled from internal sim stream (numpy / Isaac RNG)                 |
| 11 | `random_integer(p[], s)`      | AI samples discrete choices via logic layer                          |

✅ Why It Matters

| Legacy `simlib` Approach           | Champion’s Agentic USD Approach                |
|-----------------------------------|------------------------------------------------|
| Hand-written loops                | Prompt-based scene logic                       |
| Hardcoded physics assumptions     | AI interprets domain logic                     |
| Discrete queues and events        | 3D spatial and temporal flow                   |
| C with manual memory mgmt         | Python with dynamic USD graph                  |
| Per-simulation custom coding      | Reusable prompt-to-simulation agents           |

🚀 Try It: From Queue to Conveyor in Seconds

Want to simulate:

  • Items flowing through a production line?
  • Autonomous drones reacting to environment changes?
  • Human-machine interactions in safety-critical environments?

Let Champion’s AI agents handle the boring bits.

Just bring the model. We’ll handle the simulation logic.

👉 See how it works at champion3d.io

Available Now

Book a demo and get early access. Free trial!

Email Address:
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Email Address:
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.