Running Simulations¶
This guide covers all options for running simulations with Waremax.
Basic Usage¶
Run a simulation from a scenario file:
Command Options¶
Required Options¶
| Option | Description |
|---|---|
--scenario, -s |
Path to scenario YAML file |
Output Options¶
| Option | Description | Default |
|---|---|---|
--output, -o |
Output format: text or json |
text |
--output-dir |
Directory for export files | None |
Export Flags¶
| Flag | Description |
|---|---|
--per-robot |
Generate per-robot breakdown CSV |
--per-station |
Generate per-station breakdown CSV |
--heatmap |
Generate congestion heatmap CSVs |
--timeseries |
Generate time-series CSV |
--trace |
Enable event tracing |
--attribution |
Enable delay attribution for RCA |
Simulation Control¶
| Option | Description |
|---|---|
--seed |
Override scenario seed |
Output Formats¶
Text Output (Default)¶
Human-readable summary:
Output:
Simulation Complete
==================
Duration: 60.0 minutes (warmup: 5.0 minutes)
Orders:
Completed: 245
Throughput: 267.3 orders/hr
Cycle Times:
Average: 42.3s
P95: 78.5s
P99: 95.2s
Utilization:
Robot Fleet: 67.2%
Stations: 72.5%
JSON Output¶
Machine-readable format:
Output:
{
"duration_s": 3600.0,
"warmup_s": 300.0,
"orders_completed": 245,
"throughput_per_hour": 267.3,
"cycle_times": {
"mean_s": 42.3,
"p95_s": 78.5,
"p99_s": 95.2
},
"robot_utilization": 0.672,
"station_utilization": 0.725
}
Redirect to file:
Exporting Data¶
Export to Directory¶
Generate all export files:
waremax run --scenario my_scenario.yaml \
--output-dir ./results \
--per-robot \
--per-station \
--heatmap \
--timeseries \
--trace
Creates:
results/
├── report.json # Full simulation report
├── robots.csv # Per-robot metrics
├── stations.csv # Per-station metrics
├── node_congestion.csv # Node congestion scores
├── edge_congestion.csv # Edge congestion scores
├── timeseries.csv # Time series data
└── trace.csv # Event trace
Selective Exports¶
Export only specific data:
# Only robot and station breakdowns
waremax run --scenario my_scenario.yaml \
--output-dir ./results \
--per-robot \
--per-station
# Only congestion data
waremax run --scenario my_scenario.yaml \
--output-dir ./results \
--heatmap
Seed Control¶
Using Scenario Seed¶
By default, Waremax uses the seed from the scenario file:
Overriding Seed¶
Override at runtime:
Running Multiple Seeds¶
Run same configuration with different seeds:
for seed in 1 2 3 4 5; do
waremax run --scenario my_scenario.yaml \
--seed $seed \
--output json > results_seed_$seed.json
done
Performance Considerations¶
Simulation Duration¶
Longer simulations provide more stable statistics but take more time:
simulation:
duration_minutes: 60 # Production run
warmup_minutes: 10 # Allow system to reach steady state
For quick iteration:
Warmup Period¶
The warmup period allows the system to reach steady state before collecting metrics:
- Too short: Metrics influenced by startup transients
- Too long: Wastes simulation time
- Recommended: 10-20% of total duration
Build Mode¶
Always use release builds for actual simulations:
# Build release binary
cargo build --release
# Use release binary
./target/release/waremax run --scenario my_scenario.yaml
Batch Running¶
Using Compare Command¶
Compare two configurations:
waremax compare \
--baseline baseline.yaml \
--variant variant.yaml \
--replications 5 \
--output comparison.json
Using Sweep Command¶
Run parameter sweep:
waremax sweep \
--base baseline.yaml \
--sweep "robots:5,10,15,20" \
--replications 3 \
--output-dir ./sweep_results
Shell Scripts¶
Run multiple scenarios:
#!/bin/bash
for scenario in scenarios/*.yaml; do
name=$(basename "$scenario" .yaml)
waremax run --scenario "$scenario" \
--output json > "results/${name}.json"
done
Event Tracing¶
Enable detailed event logging:
Trace output includes:
| Event Type | Description |
|---|---|
OrderArrival |
New order enters system |
TaskAssignment |
Task assigned to robot |
RobotDepart |
Robot starts moving |
RobotArrive |
Robot arrives at destination |
StationServiceStart |
Robot begins service |
StationServiceEnd |
Robot completes service |
ChargingStart |
Robot begins charging |
ChargingEnd |
Robot finishes charging |
Attribution Tracking¶
Enable delay attribution for root cause analysis:
Attribution data shows:
- Time spent waiting in queues
- Time spent waiting for traffic
- Travel time breakdown
- Service time breakdown
Use with the analyze command:
Error Handling¶
Validation Errors¶
If the scenario has errors, Waremax reports them:
Fix the scenario file and retry.
Runtime Errors¶
If simulation fails during execution:
Check:
- Map connectivity
- Station node assignments
- Robot starting positions
Examples¶
Basic Run¶
Full Export¶
waremax run --scenario my_scenario.yaml \
--output-dir ./results \
--per-robot \
--per-station \
--heatmap \
--timeseries \
--trace \
--attribution
Different Seed¶
JSON to File¶
Next Steps¶
- Scenario Files - Understand scenario configuration
- Export Formats - Details on output files
- CLI Reference - Complete command reference