Examples¶
Progressive examples demonstrating Interphyre's capabilities for physics simulation, reinforcement learning, and causal inference research.
Quick Start¶
# Run the simplest example
python demos/quickstart.py
# Run all demos
for f in demos/*.py; do python $f; done
Available Examples¶
- Quickstart - Simplest usage: create env, step, check result
- Gym Interface - Standard RL training loop with Gymnasium
- Triggers - Event detection (time, contact, velocity, custom conditions)
- Interventions - Mid-simulation modifications (add objects, apply forces)
- Replanning - Multi-turn workflow: run_until, restore, continue
- Counterfactuals - Causal analysis with branching simulations
- Custom Levels - Building custom physics puzzles from scratch
Visualization¶
For interactive visualization and debugging, use the viewer module:
# Visualize a specific action
python -m interphyre.viewer catapult --seed 42 --action 0.5 3.0 0.6
# Run random demo
python -m interphyre.viewer --demo catapult --trials 10
See Tools for complete CLI documentation.
API Reference¶
For detailed API documentation, see:
- InterphyreEnv - Main environment class
- Interventions - Triggers and modifications
- Objects - Ball, Bar, Basket classes
- Level - Level model and creation