package
0.32.3
Repository: https://github.com/nextmv-io/sdk.git
Documentation: pkg.go.dev

# Packages

Package check provides a plugin that allows you check models and solutions.
Package common contains common types and functions.
Package factory is a package containing factory functions for creating next-route models.
Package schema provides the input and output schema for nextroute.

# Functions

Format formats a solution in basic format using the map function toSolutionOutputFn to map a solution to a user specific format.
NewAddExpression returns a new BinaryExpression that adds the values of the two expressions.
NewAttributesConstraint creates a new attributes constraint.
NewCluster creates a new cluster component.
NewComposedPerVehicleTypeExpression returns a new ComposedPerVehicleTypeExpression which is a composed expression that uses an expression for each vehicle type.
NewConstantDurationExpression creates a new constant duration expression.
NewConstantExpression returns an expression that always returns the same value.
NewDirectedAcyclicGraph creates a new [DirectedAcyclicGraph].
NewDistanceExpression turns a model expression into a distance expression.
NewDurationExpression creates a new duration expression.
NewEarlinessObjective creates a construct that can be added to the model as an objective.
NewExpressionObjective returns a new ExpressionObjective inteface.
NewFromStopExpression returns an expression whose value is based on the from stop in Value method.
NewFromToExpression returns an expression whose value is based on the from and to stops in Value method.
NewHaversineExpression returns a new DistanceExpression that calculates the distance between two stops using the Haversine formula.
NewLatestArrival creates a construct that can be added to the model as a constraint or as an objective.
NewLatestEnd creates a new latest end construct.
NewLatestStart creates a construct that can be added to the model as a constraint or as an objective.
NewMaximumConstraint creates a new maximum constraint.
NewMaximumDurationConstraint creates a new maximum constraint.
NewMaximumExpression returns a new BinaryExpression that returns the maximum of the values of the two expressions.
NewMaximumStopsConstraint creates a new maximum stops constraint.
NewMaximumTravelDurationConstraint creates a new maximum travel duration constraint.
NewMaximumWaitStopConstraint returns a new MaximumWaitStopConstraint.
NewMaximumWaitVehicleConstraint returns a new MaximumWaitVehicleConstraint.
NewMeasureByIndexExpression returns a new MeasureByIndexExpression.
NewMeasureByPointExpression returns a new MeasureByPointExpression.
NewMinimumExpression returns a new BinaryExpression that returns the minimum of the values of the two expressions.
NewModel creates a new empty vehicle routing model.
NewModelExpressionIndex returns the next unique expression index.
NewModelStatistics creates a new ModelStatistics instance.
NewMultiplyExpression returns a new BinaryExpression that multiplies the values of the two expressions.
NewNoMixConstraint creates a new no-mix constraint.
NewNotExecutableMove returns a new empty move.
NewOperatorExpression returns a new BinaryExpression that uses the given operator function.
NewParallelSolver creates a new parallel solver for the given work solutions.
NewPerformanceObserver creates a new PerformanceObserver.
NewRandomSolution creates a new solution.
NewScaledDurationExpression creates a new scaled duration expression.
NewSolution creates a new solution.
NewSolutionPlanUnitCollection creates a new [SolutionPlanUnitCollection].
NewSolutionStopGenerator return a solution stop iterator of a move.
NewSolver creates a new solver.
NewSolverFactory creates a new SolverFactory.
NewStopDurationExpression creates a new duration expression.
NewStopExpression returns an expression whose value is based on the to stop in Value method.
NewStopTimeExpression creates a new duration expression.
NewSumExpression returns a new SumExpression that calculates the sum of the values of the given expressions.
NewSweepSolution creates a new solution.
NewTermExpression returns a new TermExpression that calculates the product of the given factor and the value of the given expression.
NewTimeDependentDurationExpression creates a [TimeDependentDurationExpression], which takes a default expression as input.
NewTimeExpression creates a new time expression.
NewTimeIndependentDurationExpression creates a [TimeDependentDurationExpression] which is not dependent on time.
NewTravelDurationExpression creates a new travel duration expression.
NewTravelDurationObjective returns a new TravelDurationObjective that uses the travel duration as an objective.
NewUnPlannedObjective returns a new UnPlannedObjective that uses the un-planned stops as an objective.
NewVehiclesDurationObjective returns a new VehiclesDurationObjective that uses the vehicle duration as an objective.
NewVehiclesObjective returns a new VehiclesObjective that uses the number of vehicles as an objective.
NewVehicleStatistics creates a new VehicleStatistics instance.
NewVehicleTypeDistanceExpression returns a NewVehicleTypeDistanceExpression whose value is based on the vehicle type in Value method and expresses a distance.
NewVehicleTypeDurationExpression creates a new duration expression.
NewVehicleTypeExpression returns a VehicleTypeExpression whose value is based on the vehicle type in Value method.
NewVehicleTypeFromToExpression returns an expression whose value is based on the vehicle type, from and to stops in Value method.
NoPositionsHint returns a new StopPositionsHint that does not skip the vehicle and does not contain a next stop.
SkipVehiclePositionsHint returns a new StopPositionsHint that skips the vehicle.

# Constants

AtEachSolution indicates that the constraint should be checked at each solution.
AtEachStop indicates that the constraint should be checked at each stop.
AtEachVehicle indicates that the constraint should be checked at each vehicle.
Constant is a constant cost function.
CrazyExpensive is a function that is so expensive that it should never be used.
ExponentialStop is an exponential cost function with respect to the number of stops.
ExponentialVehicle is an exponential cost function with respect to the number of vehicles.
LinearStop is a linear cost function with respect to the number of stops.
LinearVehicle is a linear cost function with respect to the number of vehicles.
Never indicates that the constraint should never be checked.
OnArrival refers to the Arrival at a stop.
OnEnd refers to the End at a stop.
OnStart refers to the Start at a stop.
QuadraticStop is a quadratic cost function with respect to the number of stops.
QuadraticVehicle is a quadratic cost function with respect to the number of vehicles.

# Variables

CheckViolations is a list of all possible values for CheckedAt.

# Structs

FormatOptions are the options that influence the format of the output.
IntParameterOptions are the options for an integer parameter.
MixItem is an item that is used to specify the type of mix.
ParallelSolveOptions are the options for the parallel solver.
SolveOptions are the options for the solver.
SolverOptions are the options for the solver and it's operators.

# Interfaces

Arc is a directed connection between two nodes ([ModelStops]) that specifies that the origin stop must be planned before the destination stop on a vehicle's route.
AttributesConstraint is a constraint that limits the vehicles a plan unit can be added to.
BinaryExpression is an expression that takes two expressions as input and returns a value.
Cluster is both a constraint and an objective that limits/prefers the vehicles a plan cluster will be added to.
Complexity is the interface for constraints that have a complexity.
ComposedPerVehicleTypeExpression is an expression that uses an expression for each vehicle type.
ConstantExpression is an expression that always returns the same value.
ConstraintDataUpdater is a deprecated interface.
ConstraintReporter is the interface that can be used by a constraint if it wants to report data about the constraint for a solution stop.
ConstraintSolutionDataUpdater is the interface than can be used by a constraint if it wants to store data with each solution.
ConstraintStopDataUpdater is the interface than can be used by a constraint if it wants to store data with each stop in a solution.
ConstraintTemporal is the interface that is implemented by constraints that are temporal.
Copier is the interface that all objects that can be copied must implement.
DefaultExpression is an expression that has a default value if no other values are defined.
DirectedAcyclicGraph is a set of nodes (of type [ModelStop]) connected by arcs that does not contain cycles.
DistanceExpression is an expression that returns a distance.
DurationExpression is an expression that returns a duration.
EarlinessObjective is a construct that can be added to the model as an objective.
ExpressionObjective is an objective that uses an expression to calculate an objective.
FromStopExpression is an expression that has a value for each from stop.
FromToExpression is an expression that has a value for each combination of from and to stop.
Identifier is an interface that can be used for identifying objects.
ImmutableSolutionPlanUnitCollection is a collection of solution plan units.
LatestArrival is a construct that can be added to the model as a constraint or as an objective.
LatestEnd is a construct that can be added to the model as a constraint or as an objective.
LatestStart is a construct that can be added to the model as a constraint or as an objective.
Locker is an interface for locking a constraint.
MaximumConstraint is a constraint that limits the maximum cumulative value can be assigned to a vehicle type.
MaximumDurationConstraint is a constraint that limits the duration of a vehicle.
MaximumStopsConstraint is a constraint that limits the maximum number of stops a vehicle type can have.
MaximumTravelDurationConstraint is a constraint that limits the total travel duration of a vehicle.
MaximumWaitStopConstraint is a constraint that limits the time a vehicle can wait between two stops.
MaximumWaitVehicleConstraint is a constraint that limits the accumulated time a vehicle can wait at stops on its route.
Model defines routing problem.
ModelConstraint is the interface that all constraints must implement.
ModelData is a data interface available on several model constructs.
ModelExpression is an expression that can be used in a model to define values for constraints and objectives.
ModelObjective is an objective function that can be used to optimize a solution.
ModelObjectiveSum is a sum of model objectives.
ModelObjectiveTerm is a term in a model objective sum.
ModelPlanStopsUnit is a set of stops.
ModelPlanUnit is a plan unit.
ModelPlanUnitsUnit is a set of plan units.
ModelStatistics provides statistics for a model.
ModelStop is a stop to be assigned to a vehicle.
ModelVehicle is a vehicle in the model.
ModelVehicleType is a vehicle type.
NoMixConstraint limits the order in which stops are assigned to a vehicle based upon the items the stops insert or remove from a vehicle.
ObjectiveDataUpdater is is a deprecated interface.
ObjectiveSolutionDataUpdater is the interface than can be used by an objective if it wants to store data with each solution.
ObjectiveStopDataUpdater is the interface than can be used by an objective if it wants to store data with each stop in a solution.
ParallelSolver is the interface for parallel solver.
PerformanceObserver is an interface that is used to observe the performance of the model, and it's subsequent use.
RegisteredModelExpressions is the interface that exposes the expressions that should be registered with the model.
Solution is a solution to a model.
SolutionMove is a move in a solution.
SolutionMoveStops is a move in a solution.
SolutionObserved is an interface that can be implemented to observe the solution manipulation process.
SolutionObserver is an interface that can be implemented to observe the solution manipulation process.
SolutionPlanStopsUnit is a set of stops that are planned to be visited by a vehicle.
SolutionPlanUnit is a set of stops that are planned to be visited by a vehicle.
SolutionPlanUnitCollection is a collection of solution plan units.
SolutionPlanUnitsUnit is a set of solution plan units.
A SolutionStop is a stop that is planned to be visited by a vehicle.
SolutionStopGenerator is an iterator of solution stops.
SolutionStopViolationCheck is the interface that will be invoked on every update of a planned solution stop.
SolutionVehicle is a vehicle in a solution.
SolutionVehicleViolationCheck is the interface that will be invoked on every update of a last planned solution stop of a vehicle.
SolutionViolationCheck is the interface that will be invoked once all updates on a solution have been executed.
Solver is the interface for a solver.
SolverFactory is the interface for a solver-factory.
StopDurationExpression is a ModelExpression that returns a duration per stop and allows to set the duration per stop.
StopExpression is an expression that has a value for each to stop.
StopPosition is the definition of the change in the solution for a specific stop.
StopPositionsHint is an interface that can be used to give a hint to the solver about the next stop position.
StopTimeExpression is a ModelExpression that returns a time per stop and allows to set the time per stop.
SumExpression is an expression that returns the sum of the values of the given expressions.
TermExpression is an expression that returns the product of the given factor and the value of the given expression.
TimeDependentDurationExpression is a DurationExpression that returns a value based on time on top of a base expression.
TimeExpression is a ModelExpression that returns a time.
TravelDurationExpression is an expression that returns a duration based on a distance and a speed.
TravelDurationObjective is an objective that uses the travel duration as an objective.
UnPlannedObjective is an objective that uses the un-planned stops as an objective.
VehicleFromToExpression is an expression that has a value for each combination of vehicle type, from and to stop.
VehiclesDurationObjective is an objective that uses the vehicle duration as an objective.
VehiclesObjective is an objective that uses the number of vehicles as an objective.
VehicleStatistics provides statistics for a vehicle.
VehicleTypeDistanceExpression is an expression that returns a distance per vehicle type and allows to set the duration per vehicle.
VehicleTypeDurationExpression is a ModelExpression that returns a duration per vehicle type and allows to set the duration per vehicle type.
VehicleTypeExpression is the base expression for VehicleTypeExpressions.
VehicleTypeValueExpression is a ModelExpression that returns a value per vehicle type and allows to set the value per vehicle type.

# Type aliases

Arcs is a collection of [Arc]s.
BinaryFunction is a function that takes two float64 values and returns a float64 value.
CheckedAt is the type indicating when to check a constraint when a move it's consequences are being propagated.
Cost is type to indicate the cost of a function.
ModelConstraints is a slice of ModelConstraint.
ModelExpressions is a slice of ModelExpression.
ModelObjectives is a slice of model objectives.
ModelObjectiveTerms is a slice of model objective terms.
ModelPlanStopsUnits is a slice of model plan stops units .
ModelPlanUnits is a slice of plan units .
ModelPlanUnitsUnits is a slice of model plan units units .
ModelStops is a slice of stops.
ModelVehicles is a slice of ModelVehicle.
ModelVehicleTypes is a slice of vehicle types.
Move is a type alias for SolutionMoveStops.
SolutionMoves is a slice of SolutionMove.
SolutionObservers is a slice of SolutionObserver.
SolutionPlanStopsUnits is a slice of [SolutionPlanStopsUnit].
SolutionPlanUnits is a slice of [SolutionPlanUnit].
SolutionPlanUnitsUnits is a slice of [SolutionPlanUnitsUnit].
Solutions is a slice of solutions.
SolutionStops is a slice of SolutionStop.
SolutionVehicles is a slice of solution vehicles.
StopPositions is a slice of stop positions.
TemporalReference is a representation of OnArrival, OnEnd or OnStart as an enum.