Skip to content

Orchestrator: shift windows break VROOM runs, plus time window, capacity and greedy engine gaps #365

Description

@LeftoversTodayAppAdmin

Describe the bug

Running the orchestrator on v0.7.68 (fleetops 0.6.71) with VROOM 1.15, we hit these problems in OrchestrationPayloadBuilder and the greedy engine, most important first:

  1. Vehicle and driver shifts make every VROOM run fail with Invalid time-window. time_window_start/end are TIME columns with no cast, and the builder reads ->timestamp on the strings, so VROOM gets [null, null].
  2. The order's time window goes on the delivery step only, so for pickup orders it lands on the depot drop. Waypoint time_window_* are never read, and driver schedules use activeShiftFor(now()), so a plan for tomorrow uses today's shifts.
  3. A vehicle without payload_capacity_volume gets volume capacity 0, so orders whose entities have dimensions can never be assigned to it. payload_capacity_unit is never read (always kg), and driver max_distance is never sent to VROOM.
  4. The greedy engine reads $order->payload?->pickup?->lat, which Place doesn't have, so every distance is 0. With allow_multi_order it put all 150 of our test orders (17,360 lb) on the first van (2,000 lb capacity).
  5. The v1 Order resource doesn't return time_window_start/end, required_skills or orchestrator_priority, so clients can set them but not read them back.
Proposed fixes
  1. Parse HH:MM[:SS] onto the plan date (the run's scheduled_date, or today), and leave the window out when a bound is missing.
  2. Put each window on the step it belongs to, read waypoint windows, and use activeShiftFor($scheduledDate).
  3. Leave out a capacity dimension that no vehicle in the run defines, convert payload_capacity by its unit, and send max_distance next to max_travel_time.
  4. Use $pickup->location->getLat() / getLng() and the capacity and skills helpers the VROOM path already has.
  5. Add the four fields to Http/Resources/v1/Order.php, as Expand public Fleet, Vehicle, and Driver API contracts #311 did for vehicles and drivers.

Impact

Shifts can't be used with VROOM at all, and the other gaps produce plans that look valid but ignore the constraints.

Why

Most of these are small, local fixes, and together they make the orchestrator usable for shift-based dispatch. We're happy to send PRs; let us know if you'd like one PR or several.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions