To upgrade to this version a few steps are necessary. To make your upgrade as smooth as possible, we give a step by step introduction which covers the minimum steps required to upgrade from version 0.7.3 to 0.8.0. Please keep in mind that, depending on your own code customizations, additional steps might be necessary.
- Set your
go.mod
requirements to match the new version.
- Search for
hopm
and replace all occurrences in the import statements forengines
(i.e.,github.com/nextmv-io/code/hopm
is nowgithub.com/nextmv-io/code/engines
). - To configure a window constraint, you now have to pass five instead of three arguments. If you used a
stop_duration
ormaxWait_time
in yourmeasure
, remove it there and pass them to the window method. Note that the length of the slice must match the length of your window constraint's slice. If you do not use them, you can simply passnil
.
Note that default UnassignedPenalties behavior has changed.
- If no unassigned penalties are provided, assignment will be enforced (note, this could result in no feasible solutions being returned).
- If unassigned penalties are provided, assignment will not be enforced. Unassignment will be discouraged (more or less, based on the penalty value).
- If you are using a custom penalty in your value function to penalize unassigned locations, please remove it from there.
If you solve a VRP, use
UnassignedPenalty
for all stops in yourinput.json
and read it in yourinput.go
.- Extend stop struct with new field
UnassignedPenalty
, read your json input. - Double check that your input data has values set for
UnassignedPenalty
. If you don't set this data, they will be set to zero and, thus, will not be assigned to your routes. - Make a slice of your
UnassignedPenalty
indexed by stop and pass it to your fleet schema.
- Change deprecated
Haversine
methods, if necessary. The following code snipped should help you when applying the new method.
- The
Next()
method now takes an argument and has changed toNext(ctx context.Context)
. If you are calling it, the argument to pass iscontext.Background()
.