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

Sdk

v0.11.0 Upgrade Guide

Nextmv SDK

  • Set your go.mod requirements to match the new version.
require (
   github.com/nextmv-io/code/engines v0.11.0
   github.com/nextmv-io/code/hop v0.11.0
)
Copy
  • With this release the following router options were renamed:
    • Measures option to ValueFunctionMeasures
    • TimeMeasures option to TravelTimeMeasures
    • Limit option was renamed to Limits
  • Before, the Limits option was only limiting the value function. Since this release, the options signature has changed to support full custom limitations of routes. To limit the route's distance or duration the new options LimitDistances and LimitDurations should be used.
maxValues := []float64{1000.0, 2000.0}

router, err := route.NewRouter(
    stops,
    vehicles,
    route.Measures(measures),
    route.TimeMeasures(measures),
    route.Limit(maxValues, true),
)
Copy

Page last updated