Load Compatibility
Load compatibility lets you control which load types can coexist on a vehicle during the same trip. This is essential for waste collection (segregated waste streams), hazmat transport (incompatible materials), and any scenario where mixing certain cargo types is not allowed.Overview
Without load compatibility, the solver only checks that total load per dimension does not exceed capacity. With load compatibility, you define a matrix that restricts the effective capacity for each dimension based on what other dimensions are currently loaded.Per-Resource Configuration
Each vehicle can have its own compatibility matrix
Hard Constraint
Violations are treated as hard constraints — the solver avoids them entirely
Basic Configuration
Add aloadCompatibility matrix to any resource. The matrix dimensions must match the resource’s capacity array.
Mutually Exclusive Load Types
The most common use case: each trip carries only one type of cargo. Use a diagonal matrix where each dimension allows full capacity only for itself:- If the truck picks up
general-waste-1(load dimension 0), the effective capacity for dimensions 1 and 2 drops to 0 - The truck cannot pick up
recycling-1orpaper-1on the same trip - After visiting a depot to unload, the truck can start a new trip with a different waste stream
How the Matrix Works
TheloadCompatibility matrix is an N x N matrix where N is the number of capacity dimensions.
loadCompatibility[i][j] defines the effective maximum capacity for dimension j when dimension i has non-zero load.
When multiple dimensions are active simultaneously, the effective capacity for dimension j is:
Reading the Matrix
Consider this matrix for a 3-compartment vehicle:| When loaded with… | Dim 0 capacity | Dim 1 capacity | Dim 2 capacity |
|---|---|---|---|
| Dimension 0 only | 8000 | 0 | 0 |
| Dimension 1 only | 0 | 5000 | 0 |
| Dimension 2 only | 0 | 0 | 3000 |
Partially Compatible Types
Some cargo types can share a vehicle with reduced capacity:- Dimension 0 retains full capacity (500)
- Dimension 1 is reduced to 200
Waste Collection Example
A complete waste collection setup with 3 segregated streams, load compatibility, and depot visits:Constraint Behavior
Load compatibility is enforced as a hard constraint namedLoad Compatibility. When violated, it appears in the response’s violations section:
Load compatibility is implicitly toggleable. If you omit the
loadCompatibility field on a resource, no compatibility restrictions apply to that vehicle. You can enable it on some vehicles and leave it off on others.Best Practices
Match dimensions across jobs, resources, and depots
Match dimensions across jobs, resources, and depots
All
load arrays on jobs, capacity arrays on resources, and capacity arrays on depots must have the same number of dimensions. Mismatched dimensions cause validation errors.Combine with tags for stream assignment
Combine with tags for stream assignment
Use depots to enable multi-trip collection
Use depots to enable multi-trip collection
Load compatibility alone prevents mixing on a single trip. To collect multiple waste streams per shift, add depots so the vehicle can unload between trips and reset its load.
Related Features
Disposal Site Selection
Dynamically assign trips to optimal disposal sites
Capacity Management
Configure multi-dimensional vehicle capacity constraints
Tags & Ranking
Match jobs to vehicles using capability tags
Job Relations
Define pickup-delivery pairs and job sequencing