Steps¶
Vehicle Steps allow you to define pre-planned stops for vehicles.
What are Steps?¶
Steps enforce vehicles to perform specific jobs at specific times. Also referred to as "time pinning."
Basic Usage¶
VehicleStep Structure¶
{
"vehicles": [
{
"id": "vehicle_1",
"steps": [
{
"type": "start",
"service_at": "08:00:00"
},
{
"type": "job",
"id": "job_1",
"service_after": "09:00:00"
},
{
"type": "end",
"service_before": "18:00:00"
}
]
}
]
}
VehicleStep Fields¶
| Field | Type | Required | Description |
|---|---|---|---|
| type | StepType | Yes | Step type |
| id | String | Optional | Job ID (for job, pickup, delivery types) |
| service_at | String | Optional | Service exactly at this time "HH:MM:SS" |
| service_after | String | Optional | Service after this time |
| service_before | String | Optional | Service before this time |
StepType Enum¶
| Type | Description |
|---|---|
start |
Vehicle start |
job |
Job service |
pickup |
Pickup |
delivery |
Delivery |
break |
Break |
end |
Vehicle end |
Use Cases¶
1. Morning Start Requirement¶
Vehicle must depart from the depot at 08:00:
2. Priority Job Requirement¶
Vehicle must complete a specific job before 10:00:
3. Specific Ordering¶
Vehicle must perform pickup first, then delivery:
Time Constraints¶
service_at¶
Service exactly at the specified time:
service_after¶
Service after the specified time:
service_before¶
Service before the specified time:
Python Example¶
import requests
API_BASE_URL = "https://api.flio.ai"
API_KEY = "YOUR-API-KEY"
payload = {
"vehicles": [
{
"id": "vehicle_1",
"start": {"latitude": 41.0082, "longitude": 28.9784},
"steps": [
{"type": "start", "service_at": "08:00:00"},
{"type": "job", "id": "job_1", "service_before": "12:00:00"},
{"type": "end", "service_before": "18:00:00"}
]
}
],
"jobs": [...],
"options": {"minimize": "cost"}
}
url = f"{API_BASE_URL}/solver/optimize?apiKey={API_KEY}"
response = requests.post(url, json=payload)
result = response.json()
Vehicle Steps — Flio.ai