factory

package
v0.23.3-dev.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package factory is a package containing factory functions for creating next-route models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModel

func NewModel(
	input schema.Input,
	modelOptions Options,
	options ...nextroute.Option,
) (nextroute.Model, error)

NewModel builds a ready-to-go vehicle routing problem. The difference with nextroute.NewModel is that NewModel processes the input and options to add all features to the model, such as constraints and objectives. On the other hand, nextroute.NewModel creates an empty vehicle routing model which must be built from the ground up.

Types

type Options added in v0.23.1

type Options struct {
	Constraints struct {
		Disable struct {
			Attributes      bool `json:"attributes" usage:"ignore the compatibility attributes constraint"`
			Capacity        bool `json:"capacity" usage:"ignore the capacity constraint"`
			DistanceLimit   bool `json:"distance_limit" usage:"ignore the distance limit constraint"`
			Groups          bool `json:"groups" usage:"ignore the groups constraint"`
			MaximumDuration bool `json:"maximum_duration" usage:"ignore the maximum duration constraint"`
			MaximumStops    bool `json:"maximum_stops" usage:"ignore the maximum stops constraint"`
			Precedence      bool `json:"precedence" usage:"ignore the precedence (pickups & deliveries) constraint"`
			Shift           bool `json:"shift" usage:"ignore the shift constraint"`
			Windows         bool `json:"windows" usage:"ignore the windows constraint"`
		}
		Enable struct {
			Cluster bool `json:"cluster" usage:"enable the cluster constraint"`
		}
	}
	Objectives struct {
		Earliness          float64 `json:"earliness" usage:"factor to weigh the earliness objective" default:"1.0"`
		Lateness           float64 `json:"lateness" usage:"factor to weigh the lateness objective" default:"1.0"`
		InitializationCost float64 `json:"initialization_cost" usage:"factor to weigh the initialization cost objective" default:"1.0"`
		TravelDuration     float64 `json:"travel_duration" usage:"factor to weigh the travel duration objective" default:"1.0"`
		UnassignedStops    float64 `json:"unassigned_stops" usage:"factor to weigh the unplanned objective" default:"1.0"`
		Cluster            float64 `json:"cluster" usage:"factor to weigh the cluster objective" default:"0.0"`
	}
	Properties struct {
		Disable struct {
			ServiceDurations bool `json:"service_durations" usage:"ignore the service durations of stops"`
		}
	}
}

Options configure how the NewModel function builds nextroute.Model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL