Crate Structure¶
Organization of the Waremax workspace.
Workspace Overview¶
Waremax is a Cargo workspace with multiple crates:
waremax/
├── Cargo.toml # Workspace root
├── src/ # Main binary
│ └── main.rs
└── crates/
├── waremax-core/ # DES engine
├── waremax-config/ # Configuration
├── waremax-map/ # Map/topology
├── waremax-storage/ # Inventory
├── waremax-entities/ # Robots, stations
├── waremax-policies/ # Decision policies
├── waremax-metrics/ # Metrics collection
├── waremax-sim/ # Simulation orchestration
├── waremax-testing/ # Test utilities, presets
└── waremax-analysis/ # Result analysis
Crate Dependencies¶
waremax (binary)
│
├── waremax-sim ─────────────────┐
│ │ │
│ ├── waremax-core │
│ ├── waremax-entities ────┤
│ │ │ │
│ │ └── waremax-map │
│ │ │
│ ├── waremax-policies │
│ └── waremax-metrics │
│ │
├── waremax-config ──────────────┤
│ │
├── waremax-testing ─────────────┤
│ │
└── waremax-analysis ────────────┘
Crate Details¶
waremax-core¶
The discrete event simulation engine.
Responsibilities:
- Event scheduling and dispatch
- Time management
- Simulation lifecycle
Key Types:
Dependencies: Minimal (std only)
waremax-config¶
Configuration parsing and validation.
Responsibilities:
- YAML parsing
- Schema validation
- Default values
- Error reporting
Key Types:
Dependencies: serde, serde_yaml
waremax-map¶
Warehouse topology and pathfinding.
Responsibilities:
- Graph representation
- Shortest path calculation
- Connectivity analysis
Key Types:
pub struct WarehouseMap { ... }
pub struct Node { ... }
pub struct Edge { ... }
pub trait PathFinder { ... }
Dependencies: petgraph
waremax-storage¶
Inventory and storage management.
Responsibilities:
- Rack and bin modeling
- SKU placement
- Inventory tracking
Key Types:
Dependencies: waremax-map
waremax-entities¶
Simulation entities (robots, stations, tasks).
Responsibilities:
- Entity definitions
- State management
- Behavior implementation
Key Types:
pub struct Robot { ... }
pub struct Station { ... }
pub struct Task { ... }
pub struct Order { ... }
Dependencies: waremax-map, waremax-storage
waremax-policies¶
Decision-making policies.
Responsibilities:
- Policy trait definitions
- Built-in policy implementations
- Policy composition
Key Types:
pub trait TaskAllocationPolicy { ... }
pub trait StationAssignmentPolicy { ... }
pub trait RoutingPolicy { ... }
pub struct NearestIdlePolicy { ... }
pub struct ShortestQueuePolicy { ... }
Dependencies: waremax-entities
waremax-metrics¶
Metrics collection and aggregation.
Responsibilities:
- Event-driven metric collection
- Time series recording
- Aggregation and statistics
Key Types:
Dependencies: waremax-entities
waremax-sim¶
Simulation orchestration.
Responsibilities:
- Combine all components
- Run simulation loop
- Handle events
Key Types:
pub struct Simulation { ... }
pub struct SimulationBuilder { ... }
pub struct SimulationResult { ... }
Dependencies: All other crates
waremax-testing¶
Test utilities and presets.
Responsibilities:
- Preset scenarios
- Test helpers
- Fixture generation
Key Types:
Dependencies: waremax-config
waremax-analysis¶
Result analysis and comparison.
Responsibilities:
- Statistical analysis
- Result comparison
- Report generation
Key Types:
Dependencies: waremax-metrics
Adding a New Crate¶
1. Create Crate¶
2. Update Workspace¶
3. Add Dependencies¶
4. Export Public API¶
Versioning¶
All crates share the same version:
Testing¶
Each crate has its own tests: