Vehicle Characteristics
Vehicle characteristics encompass the various attributes and capabilities of vehicles that influence their suitability for specific tasks or routes. These characteristics can include factors like capacity, vehicle type, specialized equipment, driver skills, and availability.
The Relationship Between Vehicle Characteristics and Orders:
Vehicle characteristics and orders are intricately linked. The characteristics of a vehicle determine its ability to fulfill the requirements of an order.
Here's how they relate:
- Order requirements drive vehicle selection: The specific needs of an order dictate the type of vehicle required to service it.
- Vehicle characteristics limit order assignments: The characteristics of a vehicle restrict the types of orders it can fulfill.
- Matching characteristics and requirements is essential: Assigning orders to vehicles with incompatible characteristics leads to infeasible or inefficient routes.
- Diverse characteristics enable diverse order fulfillment: A fleet with a variety of vehicle characteristics can handle a wider range of orders.
Example:
Consider a delivery company with different types of vehicles:
- Van: Capacity of 500 cubic feet, no refrigeration.
- Refrigerated Truck: Capacity of 300 cubic feet, with refrigeration.
The company receives the following orders:
- Order A: 200 cubic feet of non-perishable goods.
- Order B: 100 cubic feet of perishable goods requiring refrigeration.
- Order C: 400 cubic feet of non-perishable goods.
In this scenario:
- The van can fulfill Order A and Order C individually but cannot fulfill Order B due to the lack of refrigeration.
- The refrigerated truck can fulfill Order B but cannot fulfill Order C due to insufficient capacity.
To fulfill all three orders, the company would need to utilize both the van (for Orders A and C) and the refrigerated truck (for Order B).
Implementation in SWAT APIs
Vehicle characteristics can be set at the vehicle level using the characteristics field. It is represented as a dictionary, where the key is the name of the characteristic, and the value is its value. The API can accept boolean and integer values, for example:
{
"ALL": true,
"frozen": false,
"perishable": false,
"weight": 4
}
Each order in this case is expected to have matching characteristics to be eligible for assignment to a vehicle using characteristics in the booking model, for example:
{
"ALL": true,
"frozen": false,
"perishable": false,
"weight": {
"max": 5,
"min": 0
}
}
In the example above, a range of values is used for weight. The booking authorizes use of any vehicle that has weight characteristics specified within the range of 0 to 5. Consequently, a vehicle with weight set to 4 can be used, while, for example, a vehicle with weight 8 will net get that booking assigned.
SWAT's algorithm assumes that a vehicle must meet all characteristics required by the booking, even though the booking may have only some restrictions applied to the vehicle in the characteristics.
For example, this would allow assignment between booking and vehicle:
vehicle.characteristics =
{
"ALL": true,
"frozen": false,
"perishable": false,
"weight": 4
}
booking.characteristics =
{
"perishable": false,
"weight": {
"max": 5,
"min": 0
}
}
The following payload would NOT allow assignment between booking and vehicle:
vehicle.characteristics =
{
"frozen": false,
"perishable": false,
"weight": 4
}
booking.characteristics =
{
"perishable": true,
"weight": {
"max": 5,
"min": 0
}
}
Also, this example NOT allow assignment between booking and vehicle:
vehicle.characteristics =
{
"perishable": false,
"weight": 4
}
booking.characteristics =
{
"frozen": false,
"perishable": true,
"weight": {
"max": 5,
"min": 0
}
}
For the Optimization API, to specify characteristic requirements for a booking, all nodes within that booking mapped using booking_uid field must share the same characteristics (for both drop-off and pickup locations).