You are viewing Nextmv legacy docs. ⚡️ Go to latest docs ⚡️

Sdk

v0.13.0 Upgrade Guide

Nextmv SDK

Note, this release includes breaking changes for fleet engine users only.

  • Set your go.mod requirements to match the new version.
require (
   github.com/nextmv-io/code/engines v0.13.0
   github.com/nextmv-io/code/hop v0.13.0
)
Copy

The here client received some updates. The WithAsyncTimeOut and WithAsyncPollingInterval have been removed and replaced by a cancellation context that is applied to the matrix functions.

cli := here.NewClient("<API_KEY>", here.WithAsyncTimeout(300), here.WithAsyncPollingInterval(600))
matrix, err := cli.DistanceMatrix(points)
Copy

The location measure - which handles service times - now also takes a new parameter, durationGroups, to apply an additional service time every time a group of stops is approached.

m := measure.Location(measure, serviceTimes)
Copy

The route.Operators option for router now has 2 parameters. The second parameter lets the user either replace or append the ALNS operators.

router, err := route.NewRouter(
    i.Stops,
    i.Vehicles,
    route.Operators(operators),
)
    if err != nil {
        return nil, err
}
Copy

The VehicleSorter sets the vehicle sorting function that determines the order in which the solver tries to assign locations.

assigner := fleetEngine.CustomAssigner(
    input,
    selector,
    groupers,
    filters,
)
Copy

See the release notes for more information on what's included in v0.13.0.

Page last updated