Time Model¶
How time is represented and advances in Waremax.
Time Representation¶
SimTime¶
Time is represented as a floating-point number of seconds:
Precision¶
- Resolution: microsecond-level
- Range: 0 to simulation duration
- No fixed time steps
Time Advancement¶
Event-Driven¶
Time only advances when processing events:
current_time = 0.0s
process(event at 10.5s) → current_time = 10.5s
process(event at 10.5s) → current_time = 10.5s (same time)
process(event at 23.8s) → current_time = 23.8s
No Idle Steps¶
If nothing happens for 30 seconds:
- Time-stepping: 30+ iterations
- DES: 0 iterations, jump directly
Simulation Phases¶
Initialization (t = 0)¶
- Create robots at starting positions
- Initialize stations
- Schedule first order arrival
- Set up initial state
Warmup Period¶
0 ────────────── warmup_end ────────────── duration
Warmup | Measurement
(no metrics) | (collect metrics)
During warmup:
- Events processed normally
- Metrics not collected
- System reaches steady state
Measurement Period¶
After warmup:
- All metrics collected
- KPIs calculated
- Results meaningful
Termination¶
Simulation ends when:
current_time >= duration- Event queue is empty
Duration Configuration¶
Effective Duration¶
Example:
- Duration: 60 minutes
- Warmup: 10 minutes
- Effective: 50 minutes of metrics
Time Calculations¶
Travel Time¶
Example:
- Edge: 15 meters
- Speed: 1.5 m/s
- Time: 15 / 1.5 = 10 seconds
Service Time¶
Depends on distribution:
# Constant
time = base + per_item × items
# Lognormal
time = sample_lognormal(base, stddev) + per_item × items
# Exponential
time = sample_exponential(mean)
Battery Consumption¶
Event Ordering¶
When events have the same time:
- Priority order by event type
- FIFO for same type
This ensures:
- Deterministic behavior
- Logical event ordering
- Consistent results
Type Priorities¶
1. SystemEvents (highest)
2. OrderArrival
3. TaskAssignment
4. RobotDepart
5. RobotArrive
6. ServiceStart
7. ServiceEnd
8. MetricsSample (lowest)
Time Units in Configuration¶
Configuration uses minutes for readability:
Internally converted to seconds:
Common Time Scales¶
| Activity | Typical Duration |
|---|---|
| Edge traversal | 2-30 seconds |
| Station service | 5-60 seconds |
| Charging (full) | 30-120 minutes |
| Maintenance | 5-15 minutes |
| Order cycle | 30-180 seconds |
Related¶
- Discrete Event Simulation - How DES works
- Event Types - Specific events
- Simulation Configuration - Duration settings