"github.com/nextmv-io/code/engines/route"
"github.com/nextmv-io/code/hop/run/cli"
"github.com/nextmv-io/code/hop/solve"
// Struct to read from JSON in.
Stops []route.Stop `json:"stops,omitempty"`
Vehicles []string `json:"vehicles,omitempty"`
Starts []route.Position `json:"starts,omitempty"`
Ends []route.Position `json:"ends,omitempty"`
// Use the CLI runner to solve a Vehicle Routing Problem.
f := func(i input, opt solve.Options) (solve.Solver, error) {
router, err := route.NewRouter(
// Set the ending locations for each vehicle using the Options function.
if err := router.Options(route.Ends(i.Ends)); err != nil {
return router.Solver(opt)