vrp_model() creates an empty model to which depots, clients and vehicle
types are added via the pipe (|>). It is the tidy equivalent of PyVRP's
Model class – the data boundary uses tibbles, not one object at a time.
Examples
clients <- tibble::tibble(
x = c(10, 25, 40), y = c(5, 30, 12),
demand = c(10, 15, 8)
)
m <- vrp_model() |>
add_depot(x = 0, y = 0) |>
add_clients(clients) |>
add_vehicle_type(num_available = 5, capacity = 100)
m
#>
#> ── VRP model ───────────────────────────────────────────────────────────────────
#> • 1 depot
#> • 3 clients
#> • 1 vehicle type