schema

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package schema provides the input and output schema for nextroute.

Package schema provides the input and output schema for nextroute.

Package schema provides the input and output schema for nextroute.

Package schema provides the input and output schema for nextroute.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCustomData added in v0.24.1

func ConvertCustomData[T any](data any) (T, error)

ConvertCustomData converts the custom data into the given type. If the conversion fails, an error is returned.

Types

type AlternateStop added in v0.30.0

type AlternateStop struct {
	// Quantity of the stop.
	Quantity any `json:"quantity,omitempty"`
	// Duration in seconds that the stop takes.
	Duration *int `json:"duration,omitempty" minimum:"0"`
	// CustomData arbitrary custom data.
	CustomData any `json:"custom_data,omitempty"`
	// MaxWait maximum waiting duration in seconds at the stop.
	MaxWait *int `json:"max_wait,omitempty" minimum:"0"`
	// StartTimeWindow time window in which the stop can start service.
	StartTimeWindow any `json:"start_time_window,omitempty"`
	// UnplannedPenalty penalty for not planning a stop.
	UnplannedPenalty *int `json:"unplanned_penalty,omitempty" minimum:"0"`
	// EarlyArrivalTimePenalty penalty per second for arriving at the stop before the target arrival time.
	EarlyArrivalTimePenalty *float64 `json:"early_arrival_time_penalty,omitempty" minimum:"0"`
	// LateArrivalTimePenalty penalty per second for arriving at the stop after the target arrival time.
	LateArrivalTimePenalty *float64 `json:"late_arrival_time_penalty,omitempty" minimum:"0"`
	// TargetArrivalTime at the stop.
	TargetArrivalTime *time.Time `json:"target_arrival_time,omitempty"`
	// ID unique identifier for the stop.
	ID string `json:"id,omitempty"`
	// Location where the stop is.
	Location Location `json:"location,omitempty"`
}

AlternateStop represents an alternate stop.

type CustomResultStatistics added in v0.26.0

type CustomResultStatistics struct {
	// ActivatedVehicles is the number of vehicles that were used in the
	// solution.
	ActivatedVehicles int `json:"activated_vehicles"`
	// UnplannedStops is the number of stops that were not planned in the
	// solution.
	UnplannedStops int `json:"unplanned_stops"`
	// MaxTravelDuration is the maximum travel duration of a vehicle in the
	// solution.
	MaxTravelDuration int `json:"max_travel_duration"`
	// MaxDuration is the maximum duration of a vehicle (including waiting
	// times) in the solution.
	MaxDuration int `json:"max_duration"`
	// MinTravelDuration is the minimum travel duration of a vehicle in the
	// solution, excluding vehicles that were not used.
	MinTravelDuration int `json:"min_travel_duration"`
	// MinDuration is the minimum duration of a vehicle (including waiting
	// times) in the solution, excluding vehicles that were not used.
	MinDuration int `json:"min_duration"`
	// MaxStopsInRoute is the maximum number of stops in a vehicle's route in
	// the solution. The start and end stops of the vehicle are not considered.
	MaxStopsInVehicle int `json:"max_stops_in_vehicle"`
	// MinStopsInRoute is the minimum number of stops in a vehicle's route in
	// the solution. The start and end stops of the vehicle are not considered.
	MinStopsInVehicle int `json:"min_stops_in_vehicle"`
}

CustomResultStatistics is an example of custom result statistics that can be added to the output and used in experiments.

type Defaults

type Defaults struct {
	// Vehicles default values for vehicles.
	Vehicles *VehicleDefaults `json:"vehicles,omitempty"`
	// Stops default values for stops.
	Stops *StopDefaults `json:"stops,omitempty"`
}

Defaults contains default values for vehicles and stops.

type DurationGroup added in v0.25.0

type DurationGroup struct {
	// Group stop IDs contained in the group.
	Group []string `json:"group,omitempty" uniqueItems:"true"`
	// Duration to add when visiting the group.
	Duration int `json:"duration,omitempty" minimum:"0"`
}

DurationGroup represents a group of stops that get additional duration whenever a stop of the group is approached for the first time.

type FleetDefaults added in v0.29.0

type FleetDefaults struct {
	Vehicles *FleetVehicleDefaults `json:"vehicles,omitempty"`
	Stops    *FleetStopDefaults    `json:"stops,omitempty"`
}

FleetDefaults holds the fleet input default data. FleetInput schema. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use Defaults instead.

type FleetInput added in v0.29.0

type FleetInput struct {
	Options        *Options        `json:"options,omitempty"`
	Defaults       *FleetDefaults  `json:"defaults,omitempty"`
	Vehicles       []FleetVehicle  `json:"vehicles,omitempty"`
	Stops          []FleetStop     `json:"stops,omitempty"`
	StopGroups     [][]string      `json:"stop_groups,omitempty"`
	AlternateStops []FleetStop     `json:"alternate_stops,omitempty"`
	DurationGroups []DurationGroup `json:"duration_groups,omitempty"`
}

FleetInput schema. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use Input instead.

func (FleetInput) ToNextRoute added in v0.29.0

func (fleetInput FleetInput) ToNextRoute() (Input, error)

ToNextRoute converters a legacy cloud fleet input into nextroute input format.

type FleetStop added in v0.29.0

type FleetStop struct {
	ID                string   `json:"id,omitempty"`
	Position          Location `json:"position,omitempty"`
	UnassignedPenalty *int     `json:"unassigned_penalty,omitempty"`
	Quantity          any      `json:"quantity,omitempty"`

	Precedes any `json:"precedes,omitempty"`

	Succeeds any `json:"succeeds,omitempty"`

	HardWindow              *[]time.Time `json:"hard_window,omitempty"`
	MaxWait                 *int         `json:"max_wait,omitempty"`
	StopDuration            *int         `json:"stop_duration,omitempty"`
	TargetTime              *time.Time   `json:"target_time,omitempty"`
	EarlinessPenalty        *float64     `json:"earliness_penalty,omitempty"`
	LatenessPenalty         *float64     `json:"lateness_penalty,omitempty"`
	CompatibilityAttributes *[]string    `json:"compatibility_attributes,omitempty"`
	// contains filtered or unexported fields
}

FleetStop holds the fleet input stop data. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use Stop instead.

type FleetStopDefaults added in v0.29.0

type FleetStopDefaults struct {
	UnassignedPenalty       *int         `json:"unassigned_penalty,omitempty"`
	Quantity                any          `json:"quantity,omitempty"`
	HardWindow              *[]time.Time `json:"hard_window,omitempty"`
	MaxWait                 *int         `json:"max_wait,omitempty"`
	StopDuration            *int         `json:"stop_duration,omitempty"`
	TargetTime              *time.Time   `json:"target_time,omitempty"`
	EarlinessPenalty        *float64     `json:"earliness_penalty,omitempty"`
	LatenessPenalty         *float64     `json:"lateness_penalty,omitempty"`
	CompatibilityAttributes *[]string    `json:"compatibility_attributes,omitempty"`
}

FleetStopDefaults holds the fleet input stop default data. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use StopDefaults instead.

type FleetVehicle added in v0.29.0

type FleetVehicle struct {
	ID       string    `json:"id,omitempty"`
	Start    *Location `json:"start,omitempty"`
	End      *Location `json:"end,omitempty"`
	Speed    *float64  `json:"speed,omitempty"`
	Capacity any       `json:"capacity,omitempty"`

	ShiftStart              *time.Time `json:"shift_start,omitempty"`
	ShiftEnd                *time.Time `json:"shift_end,omitempty"`
	CompatibilityAttributes []string   `json:"compatibility_attributes,omitempty"`
	MaxStops                *int       `json:"max_stops,omitempty"`
	MaxDistance             *int       `json:"max_distance,omitempty"`
	MaxDuration             *int       `json:"max_duration,omitempty"`
	StopDurationMultiplier  *float64   `json:"stop_duration_multiplier,omitempty"`
	Backlog                 []string   `json:"backlog,omitempty"`
	AlternateStops          []string   `json:"alternate_stops,omitempty"`
	InitializationCost      int        `json:"initialization_cost,omitempty"`
	// contains filtered or unexported fields
}

FleetVehicle holds the fleet input vehicle data. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use Vehicle instead.

type FleetVehicleDefaults added in v0.29.0

type FleetVehicleDefaults struct {
	Start                   *Location  `json:"start,omitempty"`
	End                     *Location  `json:"end,omitempty"`
	Speed                   *float64   `json:"speed,omitempty"`
	Capacity                any        `json:"capacity,omitempty"`
	ShiftStart              *time.Time `json:"shift_start,omitempty"`
	ShiftEnd                *time.Time `json:"shift_end,omitempty"`
	CompatibilityAttributes []string   `json:"compatibility_attributes,omitempty"`
	MaxStops                *int       `json:"max_stops,omitempty"`
	MaxDistance             *int       `json:"max_distance,omitempty"`
	MaxDuration             *int       `json:"max_duration,omitempty"`
}

FleetVehicleDefaults holds the fleet input vehicle default data. FleetInput schema. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use VehicleDefaults instead.

type InitialStop added in v0.23.9

type InitialStop struct {
	// Fixed whether the stop is fixed or not.
	Fixed *bool `json:"fixed,omitempty"`
	// ID unique identifier for the stop.
	ID string `json:"id"`
}

InitialStop represents an initial stop.

type Input

type Input struct {
	// Options arbitrary options.
	Options any `json:"options,omitempty"`
	// CustomData arbitrary custom data.
	CustomData any `json:"custom_data,omitempty"`
	// Defaults default properties for vehicles and stops.
	Defaults *Defaults `json:"defaults,omitempty"`
	// StopGroups group of stops that must be part of the same route.
	StopGroups *[][]string `json:"stop_groups,omitempty"`
	// DurationMatrix matrix of durations in seconds between stops.
	DurationMatrix *[][]float64 `json:"duration_matrix,omitempty"`
	// DistanceMatrix matrix of distances in meters between stops.
	DistanceMatrix *[][]float64 `json:"distance_matrix,omitempty"`
	// DurationGroups duration in seconds added when approaching the group.
	DurationGroups *[]DurationGroup `json:"duration_groups,omitempty"`
	// Vehicles to route.
	Vehicles []Vehicle `json:"vehicles,omitempty"`
	// Stops that will be routed and assigned to the vehicles.
	Stops []Stop `json:"stops,omitempty"`
	// AlternateStops a set of alternate stops for vehicles.
	AlternateStops *[]AlternateStop `json:"alternate_stops,omitempty"`
}

Input is the default input schema for nextroute.

func RouterToNextRoute

func RouterToNextRoute(routerInput RouterInput) Input

RouterToNextRoute transforms router input to nextroute input.

type Limits added in v0.29.0

type Limits struct {
	Duration string `json:"duration,omitempty"`
}

Limits represent the solver runtime limitation in fleet. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use [solve.Options] instead.

type Location added in v0.23.8

type Location struct {
	// Lon longitude of the location.
	Lon float64 `json:"lon" minimum:"-180" maximum:"180"`
	// Lat latitude of the location.
	Lat float64 `json:"lat" minimum:"-90" maximum:"90"`
}

Location represents a geographical location.

type MixItem added in v0.32.0

type MixItem struct {
	// Name is the name of the mix item.
	Name string `json:"name"`
	// Quantity is the number units of the mix items are inserted or removed from a
	// vehicle.
	Quantity int `json:"quantity"`
}

MixItem is an item that is used to specify the type of mix.

type ObjectiveOutput added in v0.23.8

type ObjectiveOutput struct {
	// Name is the name of the objective.
	Name string `json:"name"`
	// Objectives is the list of objectives.
	Objectives []ObjectiveOutput `json:"objectives,omitempty"`
	// Factor is the factor of the objective.
	Factor float64 `json:"factor,omitempty"`
	// Base is the value of the objective before the factor is applied.
	Base float64 `json:"base,omitempty"`
	// Value is the value of the objective after the factor is applied.
	Value float64 `json:"value"`
	// CustomData is the custom data of the objective.
	CustomData any `json:"custom_data,omitempty"`
}

ObjectiveOutput represents an objective as JSON.

type Options added in v0.29.0

type Options struct {
	Solver *SolverOptions `json:"solver,omitempty"`
}

Options adds solver options to the input. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use [solve.Options] instead.

type PlannedStopOutput added in v0.23.8

type PlannedStopOutput struct {
	// Stop is the input stop.
	Stop StopOutput `json:"stop"`
	// TravelDuration is the travel duration of the stop.
	TravelDuration int `json:"travel_duration"`
	// CumulativeTravelDuration is the total travel duration to get to this location.
	CumulativeTravelDuration int `json:"cumulative_travel_duration"`
	// TravelDistance is the travel distance of the stop.
	TravelDistance int `json:"travel_distance,omitempty"`
	// CumulativeTravelDistance is the total travel distance to get to this location.
	CumulativeTravelDistance int `json:"cumulative_travel_distance,omitempty"`
	// TargetArrivalTime is the target arrival time of the stop.
	TargetArrivalTime *time.Time `json:"target_arrival_time,omitempty"`
	// ArrivalTime is the arrival time of the stop.
	ArrivalTime *time.Time `json:"arrival_time,omitempty"`
	// WaitingDuration is the waiting duration of the stop in seconds.
	WaitingDuration int `json:"waiting_duration,omitempty"`
	// StartTime is the start time of the stop.
	StartTime *time.Time `json:"start_time,omitempty"`
	// Duration is the duration of the stop in seconds.
	Duration int `json:"duration,omitempty"`
	// EndTime is the end time of the stop.
	EndTime *time.Time `json:"end_time,omitempty"`
	// EarlyArrivalDuration is the early arrival duration of the stop in seconds.
	EarlyArrivalDuration int `json:"early_arrival_duration,omitempty"`
	// LateArrivalDuration is the late arrival duration of the stop in seconds.
	LateArrivalDuration int `json:"late_arrival_duration,omitempty"`
	// MixItems is the mix items of the stop.
	MixItems any `json:"mix_items,omitempty"`
	// CustomData is the custom data of the stop.
	CustomData any `json:"custom_data,omitempty"`
}

PlannedStopOutput adds information to the input stop.

type RouterInput

type RouterInput struct {
	Stops               []route.Stop         `json:"stops"`
	Vehicles            []string             `json:"vehicles"`
	InitializationCosts []float64            `json:"initialization_costs"`
	Starts              []Location           `json:"starts"`
	Ends                []Location           `json:"ends"`
	Quantities          []int                `json:"quantities"`
	Capacities          []int                `json:"capacities"`
	Precedences         []route.Job          `json:"precedences"`
	Windows             []route.Window       `json:"windows"`
	Shifts              []route.TimeWindow   `json:"shifts"`
	Penalties           []int                `json:"penalties"`
	Backlogs            []route.Backlog      `json:"backlogs"`
	VehicleAttributes   []route.Attributes   `json:"vehicle_attributes"`
	StopAttributes      []route.Attributes   `json:"stop_attributes"`
	Velocities          []float64            `json:"velocities"`
	Groups              [][]string           `json:"groups"`
	ServiceTimes        []route.Service      `json:"service_times"`
	AlternateStops      []route.Alternate    `json:"alternate_stops"`
	Limits              []route.Limit        `json:"limits"`
	DurationLimits      []float64            `json:"duration_limits"`
	DistanceLimits      []float64            `json:"distance_limits"`
	ServiceGroups       []route.ServiceGroup `json:"service_groups"`
}

RouterInput is the schema for the input of router.

type SolutionOutput added in v0.23.8

type SolutionOutput struct {
	// Unplanned is the list of stops that were not planned in the solution.
	Unplanned []StopOutput `json:"unplanned"`
	// Vehicles is the list of vehicles that were used in the solution.
	Vehicles []VehicleOutput `json:"vehicles"`
	// Objective is the objective of the solution.
	Objective ObjectiveOutput `json:"objective"`
	// Check is the check of the solution.
	Check *check.Output `json:"check,omitempty"`
}

SolutionOutput represents a solution as JSON.

type SolverOptions added in v0.29.0

type SolverOptions struct {
	Limits *Limits `json:"limits,omitempty"`
}

SolverOptions represent the solver runtime duration in legacy fleet. DEPRECATION NOTICE: this part of the API is deprecated and is no longer maintained. It will be deleted soon. Please use [solve.Options] instead.

type Stop

type Stop struct {
	// Precedes stops that must be visited after this one on the same route.
	Precedes any `json:"precedes,omitempty"`
	// Quantity of the stop.
	Quantity any `json:"quantity,omitempty"`
	// Succeeds stops that must be visited before this one on the same route.
	Succeeds any `json:"succeeds,omitempty"`
	// CustomData arbitrary custom data.
	CustomData any `json:"custom_data,omitempty"`
	// Duration in seconds that the stop takes.
	Duration *int `json:"duration,omitempty" minimum:"0"`
	// MaxWait maximum waiting duration in seconds at the stop.
	MaxWait *int `json:"max_wait,omitempty" minimum:"0"`
	// StartTimeWindow time window in which the stop can start service.
	StartTimeWindow any `json:"start_time_window,omitempty"`
	// UnplannedPenalty penalty for not planning a stop.
	UnplannedPenalty *int `json:"unplanned_penalty,omitempty" minimum:"0"`
	// EarlyArrivalTimePenalty penalty per second for arriving at the stop before the target arrival time.
	EarlyArrivalTimePenalty *float64 `json:"early_arrival_time_penalty,omitempty" minimum:"0"`
	// LateArrivalTimePenalty penalty per second for arriving at the stop after the target arrival time.
	LateArrivalTimePenalty *float64 `json:"late_arrival_time_penalty,omitempty" minimum:"0"`
	// CompatibilityAttributes attributes that the stop is compatible with.
	CompatibilityAttributes *[]string `json:"compatibility_attributes,omitempty" uniqueItems:"true"`
	// TargetArrivalTime at the stop.
	TargetArrivalTime *time.Time `json:"target_arrival_time,omitempty"`
	// ID unique identifier for the stop.
	ID string `json:"id,omitempty"`
	// Location where the stop is.
	Location Location `json:"location,omitempty"`
	// MixingItems defines the items that are inserted or removed from the vehicle when visiting the stop.
	MixingItems any `json:"mixing_items,omitempty"`
}

Stop represents a stop.

type StopDefaults

type StopDefaults struct {
	// UnplannedPenalty penalty for not planning a stop.
	UnplannedPenalty *int `json:"unplanned_penalty,omitempty" minimum:"0"`
	// Quantity of the stop.
	Quantity any `json:"quantity,omitempty"`
	// StartTimeWindow time window in which the stop can start service.
	StartTimeWindow any `json:"start_time_window,omitempty"`
	// MaxWait maximum waiting duration in seconds at the stop.
	MaxWait *int `json:"max_wait,omitempty" minimum:"0"`
	// Duration in seconds that the stop takes.
	Duration *int `json:"duration,omitempty" minimum:"0"`
	// TargetArrivalTime at the stop.
	TargetArrivalTime *time.Time `json:"target_arrival_time,omitempty"`
	// EarlyArrivalTimePenalty penalty per second for arriving at the stop before the target arrival time.
	EarlyArrivalTimePenalty *float64 `json:"early_arrival_time_penalty,omitempty" minimum:"0"`
	// LateArrivalTimePenalty penalty per second for arriving at the stop after the target arrival time.
	LateArrivalTimePenalty *float64 `json:"late_arrival_time_penalty,omitempty" minimum:"0"`
	// CompatibilityAttributes attributes that the stop is compatible with.
	CompatibilityAttributes *[]string `json:"compatibility_attributes,omitempty" uniqueItems:"true"`
}

StopDefaults contains default values for stops.

type StopOutput

type StopOutput struct {
	// ID is the ID of the stop.
	ID string `json:"id"`
	// Location is the location of the stop.
	Location Location `json:"location"`
	// CustomData is the custom data of the stop.
	CustomData any `json:"custom_data,omitempty"`
}

StopOutput is the basic struct for a stop.

type Vehicle

type Vehicle struct {
	// Capacity of the vehicle.
	Capacity any `json:"capacity,omitempty"`
	// StartLevel initial level of the vehicle.
	StartLevel any `json:"start_level,omitempty"`
	// CustomData arbitrary custom data.
	CustomData any `json:"custom_data,omitempty"`
	// CompatibilityAttributes attributes that the vehicle is compatible with.
	CompatibilityAttributes *[]string `json:"compatibility_attributes,omitempty" uniqueItems:"true"`
	// MaxDistance maximum distance in meters that the vehicle can travel.
	MaxDistance *int `json:"max_distance,omitempty" minimum:"0"`
	// StopDurationMultiplier multiplier for the duration of stops.
	StopDurationMultiplier *float64 `json:"stop_duration_multiplier,omitempty"`
	// StartTime time when the vehicle starts its route.
	StartTime *time.Time `json:"start_time,omitempty"`
	// EndTime latest time at which the vehicle ends its route.
	EndTime *time.Time `json:"end_time,omitempty"`
	// EndLocation location where the vehicle ends.
	EndLocation *Location `json:"end_location,omitempty"`
	// MinStops minimum stops that a vehicle should visit.
	MinStops *int `json:"min_stops,omitempty" minimum:"0"`
	// MinStopsPenalty penalty for not visiting the minimum number of stops.
	MinStopsPenalty *float64 `json:"min_stops_penalty,omitempty" minimum:"0"`
	// MaxStops maximum number of stops that the vehicle can visit.
	MaxStops *int `json:"max_stops,omitempty"`
	// Speed of the vehicle in meters per second.
	Speed *float64 `json:"speed,omitempty" minimumExclusive:"0"`
	// MaxDuration maximum duration in seconds that the vehicle can travel.
	MaxDuration *int `json:"max_duration,omitempty" minimum:"0"`
	// MaxWait maximum aggregated waiting time that the vehicle can wait across route stops.
	MaxWait *int `json:"max_wait,omitempty" minimum:"0"`
	// ActivationPenalty penalty of using the vehicle.
	ActivationPenalty *int `json:"activation_penalty,omitempty"`
	// StartLocation location where the vehicle starts.
	StartLocation *Location `json:"start_location,omitempty"`
	// AlternateStops a set of alternate stops for which only one should be serviced.
	AlternateStops *[]string `json:"alternate_stops,omitempty" uniqueItems:"true"`
	// InitialStops initial stops planned on the vehicle.
	InitialStops *[]InitialStop `json:"initial_stops,omitempty" uniqueItems:"true"`
	// ID of the vehicle.
	ID string `json:"id,omitempty"`
}

Vehicle represents a vehicle.

type VehicleDefaults

type VehicleDefaults struct {
	// Capacity of the vehicle.
	Capacity any `json:"capacity,omitempty"`
	// StartLevel initial level of the vehicle.
	StartLevel any `json:"start_level,omitempty"`
	// StartLocation location where the vehicle starts..
	StartLocation *Location `json:"start_location,omitempty"`
	// EndLocation location where the vehicle ends..
	EndLocation *Location `json:"end_location,omitempty"`
	// Speed of the vehicle in meters per second.
	Speed *float64 `json:"speed,omitempty" minimumExclusive:"0"`
	// StartTime time when the vehicle starts its route.
	StartTime *time.Time `json:"start_time,omitempty"`
	// EndTime latest time at which the vehicle ends its route.
	EndTime *time.Time `json:"end_time,omitempty"`
	// MinStops minimum stops that a vehicle should visit.
	MinStops *int `json:"min_stops,omitempty" minimum:"0"`
	// MinStopsPenalty penalty for not visiting the minimum number of stops.
	MinStopsPenalty *float64 `json:"min_stops_penalty,omitempty" minimum:"0"`
	// MaxStops maximum number of stops that the vehicle can visit.
	MaxStops *int `json:"max_stops,omitempty" minimum:"0"`
	// MaxDistance maximum distance in meters that the vehicle can travel.
	MaxDistance *int `json:"max_distance,omitempty" minimum:"0"`
	// MaxDuration maximum duration in seconds that the vehicle can travel.
	MaxDuration *int `json:"max_duration,omitempty" minimum:"0"`
	// MaxWait maximum aggregated waiting time that the vehicle can wait across route stops.
	MaxWait *int `json:"max_wait,omitempty" minimum:"0"`
	// CompatibilityAttributes attributes that the vehicle is compatible with.
	CompatibilityAttributes *[]string `json:"compatibility_attributes,omitempty" uniqueItems:"true"`
	// ActivationPenalty penalty of using the vehicle.
	ActivationPenalty *int `json:"activation_penalty,omitempty"`
	// AlternateStops a set of alternate stops for which only one should be serviced.
	AlternateStops *[]string `json:"alternate_stops,omitempty" uniqueItems:"true"`
}

VehicleDefaults contains default values for vehicles.

type VehicleOutput

type VehicleOutput struct {
	// ID is the ID of the vehicle.
	ID string `json:"id"`
	// Route is the list of stops in the route of the vehicle.
	Route []PlannedStopOutput `json:"route"`
	// RouteTravelDuration is the total travel duration of the vehicle.
	RouteTravelDuration int `json:"route_travel_duration"`
	// RouteTravelDistance is the total travel distance of the vehicle.
	RouteTravelDistance int `json:"route_travel_distance,omitempty"`
	// RouteStopsDuration is the total stops duration of the vehicle.
	RouteStopsDuration int `json:"route_stops_duration,omitempty"`
	// RouteWaitingDuration is the total waiting duration of the vehicle.
	RouteWaitingDuration int `json:"route_waiting_duration,omitempty"`
	// RouteDuration is the total duration of the vehicle.
	RouteDuration int `json:"route_duration"`
	// CustomData is the custom data of the vehicle.
	CustomData any `json:"custom_data,omitempty"`
	// AlternateStops is the list of alternate stops selected.
	AlternateStops *[]string `json:"alternate_stops,omitempty"`
}

VehicleOutput holds the solution of the ModelVehicle Routing Problem.

Jump to

Keyboard shortcuts

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