@solvice/routing 0.17.0-beta.0 → 0.17.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v3.d.ts +109 -76
- package/package.json +1 -1
package/dist/v3.d.ts
CHANGED
|
@@ -302,13 +302,14 @@ export interface components {
|
|
|
302
302
|
ConstraintCode: string;
|
|
303
303
|
/**
|
|
304
304
|
* @description What running a vehicle costs, in the request's currency
|
|
305
|
-
* (`objective.currency` is only a label).
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* resolves on its own: the shift's value,
|
|
309
|
-
* fleet's, else the default. Nothing is added
|
|
310
|
-
* every field is reported under the same
|
|
311
|
-
* level. `0` means priced at zero; absent
|
|
305
|
+
* (`objective.currency` is only a label). `objective.costs` prices the fleet
|
|
306
|
+
* and `vehicles[].costs` replaces a field for one vehicle; `shifts[].costs`
|
|
307
|
+
* is the same without `per_used_vehicle` (schema `ShiftCosts`), and replaces
|
|
308
|
+
* a field for one shift. Each field resolves on its own: the shift's value,
|
|
309
|
+
* else the vehicle's, else the fleet's, else the default. Nothing is added
|
|
310
|
+
* on top of a fleet rate, and every field is reported under the same
|
|
311
|
+
* `score.components` key at every level. `0` means priced at zero; absent
|
|
312
|
+
* means inherit.
|
|
312
313
|
*
|
|
313
314
|
* Rates are rounded to the internal grid (1/100 000 of a currency unit per
|
|
314
315
|
* second or per metre); a nonzero rate too small to represent is rejected.
|
|
@@ -335,9 +336,11 @@ export interface components {
|
|
|
335
336
|
/**
|
|
336
337
|
* Format: double
|
|
337
338
|
* @description Flat charge for each used shift (a route with at least one task),
|
|
338
|
-
* reported in `score.components.routes`. Default `0`.
|
|
339
|
-
*
|
|
340
|
-
*
|
|
339
|
+
* reported in `score.components.routes`. Default `0`. The higher it is,
|
|
340
|
+
* the more travel the solver accepts to avoid opening another route. It
|
|
341
|
+
* counts shifts, not vehicles: a vehicle that works five days pays it five
|
|
342
|
+
* times, so it does not prefer one vehicle on two shifts over two vehicles
|
|
343
|
+
* on one shift each; use `per_used_vehicle` for that.
|
|
341
344
|
* @example 50
|
|
342
345
|
*/
|
|
343
346
|
per_route?: number | null;
|
|
@@ -357,6 +360,18 @@ export interface components {
|
|
|
357
360
|
* @example 0.2
|
|
358
361
|
*/
|
|
359
362
|
per_travel_km?: number | null;
|
|
363
|
+
/**
|
|
364
|
+
* Format: double
|
|
365
|
+
* @description Flat charge once per vehicle that serves at least one task, however
|
|
366
|
+
* many of its shifts it works. Reported in `score.components.vehicles`.
|
|
367
|
+
* Adds to `per_route`: the vehicle's first used shift pays both, later
|
|
368
|
+
* shifts only `per_route`. Default `0`. Use it to minimise distinct
|
|
369
|
+
* vehicles; use `per_route` to price each working day. Not accepted on
|
|
370
|
+
* `shifts[].costs`. When any vehicle has a non-zero rate and any vehicle
|
|
371
|
+
* has several shifts, the problem solves without decomposition.
|
|
372
|
+
* @example 400
|
|
373
|
+
*/
|
|
374
|
+
per_used_vehicle?: number | null;
|
|
360
375
|
/**
|
|
361
376
|
* Format: double
|
|
362
377
|
* @description Per hour spent waiting for a time window to open, reported in
|
|
@@ -877,8 +892,9 @@ export interface components {
|
|
|
877
892
|
* (the summed `priority` of the required tasks left unassigned is
|
|
878
893
|
* minimised), then **minimise cost** — the `costs` rates plus every priced
|
|
879
894
|
* preference, reported as `score.cost`. There is no separate vehicle-count
|
|
880
|
-
* step: to use fewer
|
|
881
|
-
*
|
|
895
|
+
* step: to use fewer routes, price them with `costs.per_route`
|
|
896
|
+
* (per used shift); to use fewer distinct vehicles when they work several
|
|
897
|
+
* shifts, price them with `costs.per_used_vehicle` (once per vehicle).
|
|
882
898
|
* @example {
|
|
883
899
|
* "costs": {
|
|
884
900
|
* "per_route_hour": 35,
|
|
@@ -1354,7 +1370,8 @@ export interface components {
|
|
|
1354
1370
|
* Hard. Overlapping `all_or_none` relations chain: one on A and B plus
|
|
1355
1371
|
* one on B and C serve all three together or none of them. A group with
|
|
1356
1372
|
* a task in a vehicle's locked prefix (`plan.routes[].locked_count`) is
|
|
1357
|
-
* exempt.
|
|
1373
|
+
* exempt. A member that could be served but is held back because
|
|
1374
|
+
* another cannot reports `all_or_none` in `unassigned[].reasons`.
|
|
1358
1375
|
*
|
|
1359
1376
|
* Every task must also be named by a `synchronized` or `time_lag`
|
|
1360
1377
|
* relation; a task named by neither is rejected with HTTP 400.
|
|
@@ -2017,6 +2034,7 @@ export interface components {
|
|
|
2017
2034
|
* "tag_preference": 0,
|
|
2018
2035
|
* "target": 0,
|
|
2019
2036
|
* "time": 57.1536,
|
|
2037
|
+
* "vehicles": 0,
|
|
2020
2038
|
* "waiting": 0,
|
|
2021
2039
|
* "window_choice": 0,
|
|
2022
2040
|
* "workload_share": 0
|
|
@@ -2073,6 +2091,7 @@ export interface components {
|
|
|
2073
2091
|
* "tag_preference": 0,
|
|
2074
2092
|
* "target": 0,
|
|
2075
2093
|
* "time": 57.1536,
|
|
2094
|
+
* "vehicles": 0,
|
|
2076
2095
|
* "waiting": 0,
|
|
2077
2096
|
* "window_choice": 0,
|
|
2078
2097
|
* "workload_share": 0
|
|
@@ -2128,7 +2147,7 @@ export interface components {
|
|
|
2128
2147
|
reloads: number;
|
|
2129
2148
|
/**
|
|
2130
2149
|
* Format: double
|
|
2131
|
-
* @description
|
|
2150
|
+
* @description Shift cost, in currency units: `costs.per_route` once per used shift,
|
|
2132
2151
|
* at the shift's, vehicle's or fleet's rate.
|
|
2133
2152
|
*/
|
|
2134
2153
|
routes: number;
|
|
@@ -2150,6 +2169,13 @@ export interface components {
|
|
|
2150
2169
|
* `costs.per_route_hour` (shift, vehicle or fleet).
|
|
2151
2170
|
*/
|
|
2152
2171
|
time: number;
|
|
2172
|
+
/**
|
|
2173
|
+
* Format: double
|
|
2174
|
+
* @description Vehicle cost, in currency units: `costs.per_used_vehicle` once per
|
|
2175
|
+
* vehicle that serves a task, however many of its shifts it works, at the
|
|
2176
|
+
* vehicle's or fleet's rate.
|
|
2177
|
+
*/
|
|
2178
|
+
vehicles: number;
|
|
2153
2179
|
/**
|
|
2154
2180
|
* Format: double
|
|
2155
2181
|
* @description Cost of waiting for time windows to open, in currency units: each
|
|
@@ -2281,8 +2307,10 @@ export interface components {
|
|
|
2281
2307
|
* @description Costs for this shift only. Each field set here replaces the same
|
|
2282
2308
|
* field of the vehicle's `costs` (or, when the vehicle does not set it,
|
|
2283
2309
|
* of `objective.costs`) for this shift; fields not set keep that value.
|
|
2310
|
+
* `per_used_vehicle` is not accepted here: it prices the vehicle, not a
|
|
2311
|
+
* shift.
|
|
2284
2312
|
*/
|
|
2285
|
-
costs?: null | components["schemas"]["
|
|
2313
|
+
costs?: null | components["schemas"]["ShiftCosts"];
|
|
2286
2314
|
/** @description Where the shift ends. Absent = open end. */
|
|
2287
2315
|
end?: null | components["schemas"]["ShiftPlace"];
|
|
2288
2316
|
/**
|
|
@@ -2405,6 +2433,51 @@ export interface components {
|
|
|
2405
2433
|
*/
|
|
2406
2434
|
to: string;
|
|
2407
2435
|
};
|
|
2436
|
+
/**
|
|
2437
|
+
* @description The `Costs` fields for one shift, minus `per_used_vehicle`. A shift is one
|
|
2438
|
+
* of a vehicle's days, so a charge for using the vehicle at all is set on the
|
|
2439
|
+
* vehicle (or the fleet), where it applies once across its shifts. A field
|
|
2440
|
+
* set here replaces the vehicle's value (else the fleet's) for this shift
|
|
2441
|
+
* only; the `Costs` schema says what each field prices.
|
|
2442
|
+
* @example {
|
|
2443
|
+
* "per_route": 50,
|
|
2444
|
+
* "per_travel_km": 0.3
|
|
2445
|
+
* }
|
|
2446
|
+
*/
|
|
2447
|
+
ShiftCosts: {
|
|
2448
|
+
/**
|
|
2449
|
+
* Format: double
|
|
2450
|
+
* @description Per hour this route finishes past the shift's `to`, as
|
|
2451
|
+
* `Costs.per_overtime_hour`.
|
|
2452
|
+
* @example 0
|
|
2453
|
+
*/
|
|
2454
|
+
per_overtime_hour?: number | null;
|
|
2455
|
+
/**
|
|
2456
|
+
* Format: double
|
|
2457
|
+
* @description Flat charge for this used shift, as `Costs.per_route`.
|
|
2458
|
+
* @example 50
|
|
2459
|
+
*/
|
|
2460
|
+
per_route?: number | null;
|
|
2461
|
+
/**
|
|
2462
|
+
* Format: double
|
|
2463
|
+
* @description Per hour of this route's wall-clock span, as `Costs.per_route_hour`.
|
|
2464
|
+
* @example 35
|
|
2465
|
+
*/
|
|
2466
|
+
per_route_hour?: number | null;
|
|
2467
|
+
/**
|
|
2468
|
+
* Format: double
|
|
2469
|
+
* @description Per kilometre driven on this shift, as `Costs.per_travel_km`.
|
|
2470
|
+
* @example 0.2
|
|
2471
|
+
*/
|
|
2472
|
+
per_travel_km?: number | null;
|
|
2473
|
+
/**
|
|
2474
|
+
* Format: double
|
|
2475
|
+
* @description Per hour spent waiting for a time window to open on this shift, as
|
|
2476
|
+
* `Costs.per_wait_hour`.
|
|
2477
|
+
* @example 0
|
|
2478
|
+
*/
|
|
2479
|
+
per_wait_hour?: number | null;
|
|
2480
|
+
};
|
|
2408
2481
|
/**
|
|
2409
2482
|
* @description Per-shift limits: the route-level `limits` fields a shift may override.
|
|
2410
2483
|
* Period limits apply across shifts, so they stay on the vehicle.
|
|
@@ -2723,10 +2796,10 @@ export interface components {
|
|
|
2723
2796
|
*/
|
|
2724
2797
|
time_limit_s?: number | null;
|
|
2725
2798
|
/**
|
|
2726
|
-
* @description What to do when
|
|
2727
|
-
*
|
|
2728
|
-
*
|
|
2729
|
-
*
|
|
2799
|
+
* @description What to do when travel times cannot be fetched from Solvice Maps:
|
|
2800
|
+
* `estimate` (the default) solves on estimated travel and sets
|
|
2801
|
+
* `summary.travel_estimated`; `fail` returns the 502/503 instead.
|
|
2802
|
+
* Locations that Maps rejects for spanning more than one region are a 400.
|
|
2730
2803
|
* @default estimate
|
|
2731
2804
|
*/
|
|
2732
2805
|
travel_fallback?: null | components["schemas"]["TravelFallback"];
|
|
@@ -2966,6 +3039,7 @@ export interface components {
|
|
|
2966
3039
|
* "tag_preference": 0,
|
|
2967
3040
|
* "target": 0,
|
|
2968
3041
|
* "time": 57.1536,
|
|
3042
|
+
* "vehicles": 0,
|
|
2969
3043
|
* "waiting": 0,
|
|
2970
3044
|
* "window_choice": 0,
|
|
2971
3045
|
* "workload_share": 0
|
|
@@ -3299,6 +3373,7 @@ export interface components {
|
|
|
3299
3373
|
* "tag_preference": 0,
|
|
3300
3374
|
* "target": 0,
|
|
3301
3375
|
* "time": 57.1536,
|
|
3376
|
+
* "vehicles": 0,
|
|
3302
3377
|
* "waiting": 0,
|
|
3303
3378
|
* "window_choice": 0,
|
|
3304
3379
|
* "workload_share": 0
|
|
@@ -3361,15 +3436,14 @@ export interface components {
|
|
|
3361
3436
|
/** @description Where the request's time went. */
|
|
3362
3437
|
timings: components["schemas"]["Timings"];
|
|
3363
3438
|
/**
|
|
3364
|
-
* @description `true` when
|
|
3439
|
+
* @description `true` when travel times could not be fetched and the plan was costed
|
|
3365
3440
|
* on estimated travel: straight-line distance × a detour factor, at a
|
|
3366
3441
|
* typical speed for the profile. No one-way streets or traffic, so it
|
|
3367
3442
|
* can be tens of percent off: the plan, `unassigned[].reasons` and
|
|
3368
|
-
* `score.violation_count` hold only against it, and no `routes[].polyline`
|
|
3369
|
-
* returned. Solve again once Maps is back if the plan must hold on the
|
|
3370
|
-
* road; `options.travel_fallback: "fail"` returns the error
|
|
3371
|
-
* Absent when travel is road-routed
|
|
3372
|
-
* which returns the error rather than estimate.
|
|
3443
|
+
* `score.violation_count` hold only against it, and no `routes[].polyline`
|
|
3444
|
+
* is returned. Solve again once Maps is back if the plan must hold on the
|
|
3445
|
+
* road; on a solve, `options.travel_fallback: "fail"` returns the error
|
|
3446
|
+
* instead. Absent when travel is road-routed.
|
|
3373
3447
|
*/
|
|
3374
3448
|
travel_estimated?: boolean;
|
|
3375
3449
|
/**
|
|
@@ -3722,7 +3796,7 @@ export interface components {
|
|
|
3722
3796
|
};
|
|
3723
3797
|
/**
|
|
3724
3798
|
* @description `options.travel_fallback`: what a solve does when travel times cannot be
|
|
3725
|
-
* fetched. `/evaluate` and `/suggest`
|
|
3799
|
+
* fetched. `/evaluate` and `/suggest` always estimate.
|
|
3726
3800
|
* @example estimate
|
|
3727
3801
|
* @enum {string}
|
|
3728
3802
|
*/
|
|
@@ -3752,8 +3826,9 @@ export interface components {
|
|
|
3752
3826
|
*/
|
|
3753
3827
|
UnassignedReason: {
|
|
3754
3828
|
/**
|
|
3755
|
-
* @description The constraint that refused the task on at least one vehicle
|
|
3756
|
-
*
|
|
3829
|
+
* @description The constraint that refused the task on at least one vehicle (or
|
|
3830
|
+
* `all_or_none`, for a task its group holds back), in the vocabulary of
|
|
3831
|
+
* the evaluate violations' `code`. A task lists one reason
|
|
3757
3832
|
* per constraint, once each, in [`ConstraintCode`] order. Absent on the
|
|
3758
3833
|
* single reason of a `time_limit` or `priced_out` task, which names no
|
|
3759
3834
|
* constraint.
|
|
@@ -3794,8 +3869,9 @@ export interface components {
|
|
|
3794
3869
|
* @description Never empty. When `category` is `impossible` or `blocked` there is
|
|
3795
3870
|
* one reason per constraint that refused the task on at least one
|
|
3796
3871
|
* vehicle, named in `constraint`, once each, `unreachable` first
|
|
3797
|
-
* (`unknown` when no constraint was recorded)
|
|
3798
|
-
*
|
|
3872
|
+
* (`unknown` when no constraint was recorded); a task that fits but
|
|
3873
|
+
* whose `all_or_none` group holds it back has the one reason
|
|
3874
|
+
* `all_or_none`. Otherwise there is one reason with no `constraint`.
|
|
3799
3875
|
*/
|
|
3800
3876
|
reasons: components["schemas"]["UnassignedReason"][];
|
|
3801
3877
|
/**
|
|
@@ -4150,7 +4226,7 @@ export interface components {
|
|
|
4150
4226
|
* reach (the service time of the tasks whose windows overlap it), weighted
|
|
4151
4227
|
* by shift length, so a day with no tasks carries none of the share; each
|
|
4152
4228
|
* shift is charged on its own part. An empty, non-exempt shift pays for its whole share, so pair the
|
|
4153
|
-
* term with `costs.
|
|
4229
|
+
* term with `costs.per_route` or `per_used_vehicle` only when both are meant.
|
|
4154
4230
|
* See `vehicles[].workload_weight` to give a part-time vehicle a smaller
|
|
4155
4231
|
* share. A problem that sets the term solves without decomposition, like
|
|
4156
4232
|
* `assignment_costs`.
|
|
@@ -4299,38 +4375,6 @@ export interface operations {
|
|
|
4299
4375
|
"application/json": components["schemas"]["ErrorBody"];
|
|
4300
4376
|
};
|
|
4301
4377
|
};
|
|
4302
|
-
/** @description Travel times and distances could not be fetched (`code: travel_provider_error`). The request can be retried. This endpoint never falls back to estimated travel. */
|
|
4303
|
-
502: {
|
|
4304
|
-
headers: {
|
|
4305
|
-
/** @description The request's `X-Request-Id`, echoed, or a generated `req_…` id. */
|
|
4306
|
-
"x-request-id"?: string;
|
|
4307
|
-
[name: string]: unknown;
|
|
4308
|
-
};
|
|
4309
|
-
content: {
|
|
4310
|
-
"application/json": components["schemas"]["ErrorBody"];
|
|
4311
|
-
};
|
|
4312
|
-
};
|
|
4313
|
-
/** @description Solvice Maps is temporarily refused after repeated failures (`code: overloaded`), so travel times cannot be fetched. Evaluate takes no solver slot, so this is its only 503. Retry after the number of seconds in the `Retry-After` header. */
|
|
4314
|
-
503: {
|
|
4315
|
-
headers: {
|
|
4316
|
-
/** @description Seconds to wait before retrying. */
|
|
4317
|
-
"Retry-After"?: number;
|
|
4318
|
-
/** @description The request's `X-Request-Id`, echoed, or a generated `req_…` id. */
|
|
4319
|
-
"x-request-id"?: string;
|
|
4320
|
-
[name: string]: unknown;
|
|
4321
|
-
};
|
|
4322
|
-
content: {
|
|
4323
|
-
/**
|
|
4324
|
-
* @example {
|
|
4325
|
-
* "code": "overloaded",
|
|
4326
|
-
* "message": "Circuit breaker is open — Solvice Maps temporarily unavailable",
|
|
4327
|
-
* "request_id": "req_7f3a2c90d1e4b5a6",
|
|
4328
|
-
* "status": "SERVICE_UNAVAILABLE"
|
|
4329
|
-
* }
|
|
4330
|
-
*/
|
|
4331
|
-
"application/json": components["schemas"]["ErrorBody"];
|
|
4332
|
-
};
|
|
4333
|
-
};
|
|
4334
4378
|
};
|
|
4335
4379
|
};
|
|
4336
4380
|
solve: {
|
|
@@ -4450,7 +4494,7 @@ export interface operations {
|
|
|
4450
4494
|
"application/json": components["schemas"]["ErrorBody"];
|
|
4451
4495
|
};
|
|
4452
4496
|
};
|
|
4453
|
-
/** @description Travel times and distances could not be fetched (`code: travel_provider_error`). The request can be retried.
|
|
4497
|
+
/** @description Travel times and distances could not be fetched (`code: travel_provider_error`). The request can be retried. Only with `options.travel_fallback: "fail"`; by default the plan is solved on estimated travel and `summary.travel_estimated` is set. */
|
|
4454
4498
|
502: {
|
|
4455
4499
|
headers: {
|
|
4456
4500
|
/** @description The request's `X-Request-Id`, echoed, or a generated `req_…` id. */
|
|
@@ -4601,18 +4645,7 @@ export interface operations {
|
|
|
4601
4645
|
"application/json": components["schemas"]["ErrorBody"];
|
|
4602
4646
|
};
|
|
4603
4647
|
};
|
|
4604
|
-
/** @description
|
|
4605
|
-
502: {
|
|
4606
|
-
headers: {
|
|
4607
|
-
/** @description The request's `X-Request-Id`, echoed, or a generated `req_…` id. */
|
|
4608
|
-
"x-request-id"?: string;
|
|
4609
|
-
[name: string]: unknown;
|
|
4610
|
-
};
|
|
4611
|
-
content: {
|
|
4612
|
-
"application/json": components["schemas"]["ErrorBody"];
|
|
4613
|
-
};
|
|
4614
|
-
};
|
|
4615
|
-
/** @description No capacity right now (`code: overloaded`): every solver slot is busy, the wait for one timed out, or Solvice Maps is temporarily refused after repeated failures. Retry after the number of seconds in the `Retry-After` header. */
|
|
4648
|
+
/** @description No capacity right now (`code: overloaded`): every solver slot is busy, or the wait for one timed out. Retry after the number of seconds in the `Retry-After` header. */
|
|
4616
4649
|
503: {
|
|
4617
4650
|
headers: {
|
|
4618
4651
|
/** @description Seconds to wait before retrying. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solvice/routing",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2-beta.0",
|
|
4
4
|
"description": "TypeScript client for the Solvice V3 routing API, generated from its OpenAPI spec.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://docs.solvice.io/guides/platform/sdks/typescript",
|