vrp

package
v0.0.0-...-70edc5c Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const EARTH_RADIUS = 6.3781 * 1e6
View Source
const EPSILON = 0.1

initial interest (in order to evaluate utility function)

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocation

type Allocation map[int]float64

schema for allocation: app ID --> allocated interest

func (Allocation) String

func (a Allocation) String() string

func (Allocation) Total

func (a Allocation) Total() float64

type DedicatePdptwSolver

type DedicatePdptwSolver struct {
	// contains filtered or unexported fields
}

dedicate vehicle solver

func (*DedicatePdptwSolver) GetInterestMap

func (d *DedicatePdptwSolver) GetInterestMap() common.InterestMap

func (*DedicatePdptwSolver) GetRTH

func (d *DedicatePdptwSolver) GetRTH() []common.Location

func (*DedicatePdptwSolver) GetTravelTimeMatrixPath

func (d *DedicatePdptwSolver) GetTravelTimeMatrixPath() string

func (*DedicatePdptwSolver) New

func (d *DedicatePdptwSolver) New() Solver

func (*DedicatePdptwSolver) Set

func (d *DedicatePdptwSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location)

func (*DedicatePdptwSolver) SetInitialSchedule

func (d *DedicatePdptwSolver) SetInitialSchedule(s Schedule)

func (*DedicatePdptwSolver) SetInterestMap

func (d *DedicatePdptwSolver) SetInterestMap(im common.InterestMap)

func (*DedicatePdptwSolver) SetTravelTimeMatrixPath

func (d *DedicatePdptwSolver) SetTravelTimeMatrixPath(p string)

func (*DedicatePdptwSolver) Solve

func (d *DedicatePdptwSolver) Solve() Schedule

type DedicateSolver

type DedicateSolver struct {
	// contains filtered or unexported fields
}

dedicate vehicle solver

func (*DedicateSolver) GetInterestMap

func (d *DedicateSolver) GetInterestMap() common.InterestMap

func (*DedicateSolver) GetRTH

func (d *DedicateSolver) GetRTH() []common.Location

func (*DedicateSolver) GetTravelTimeMatrixPath

func (d *DedicateSolver) GetTravelTimeMatrixPath() string

func (*DedicateSolver) New

func (d *DedicateSolver) New() Solver

func (*DedicateSolver) Set

func (d *DedicateSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location)

func (*DedicateSolver) SetInitialSchedule

func (d *DedicateSolver) SetInitialSchedule(s Schedule)

func (*DedicateSolver) SetInterestMap

func (d *DedicateSolver) SetInterestMap(im common.InterestMap)

func (*DedicateSolver) SetTravelTimeMatrixPath

func (d *DedicateSolver) SetTravelTimeMatrixPath(p string)

func (*DedicateSolver) Solve

func (d *DedicateSolver) Solve() Schedule

type GoogleSolver

type GoogleSolver struct {
	// contains filtered or unexported fields
}

wrapper for ORTools solver (written in Python)

func NewGoogleSolver

func NewGoogleSolver(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location) *GoogleSolver

func (*GoogleSolver) GetInterestMap

func (g *GoogleSolver) GetInterestMap() common.InterestMap

func (*GoogleSolver) GetRTH

func (g *GoogleSolver) GetRTH() []common.Location

func (*GoogleSolver) GetTravelTimeMatrixPath

func (g *GoogleSolver) GetTravelTimeMatrixPath() string

func (*GoogleSolver) New

func (g *GoogleSolver) New() Solver

func (*GoogleSolver) Set

func (g *GoogleSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location)

func (*GoogleSolver) SetInitialSchedule

func (g *GoogleSolver) SetInitialSchedule(s Schedule)

func (*GoogleSolver) SetInterestMap

func (g *GoogleSolver) SetInterestMap(im common.InterestMap)

func (*GoogleSolver) SetTravelTimeMatrixPath

func (g *GoogleSolver) SetTravelTimeMatrixPath(p string)

func (*GoogleSolver) Solve

func (g *GoogleSolver) Solve() Schedule

type Input

type Input struct {
	InterestMap           common.InterestFile `json:"interest_map"`
	UnweightedInterestMap common.InterestFile `json:"unweighted_interest_map"`
	Vehicles              []common.Vehicle    `json:"vehicles"`
	Budget                int                 `json:"budget"`
	Capacity              int                 `json:"capacity"`
	InitialSchedule       Schedule            `json:"initial_schedule"`
	TravelTimeMatrixPath  string              `json:"travel_time_matrix_path"`
	RTH                   []common.Location   `json:"rth"`
}

schema for solver input

type PdptwSolver

type PdptwSolver struct {
	// contains filtered or unexported fields
}

wrapper for pdptw solver (written in Python)

func NewPdptwSolver

func NewPdptwSolver(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location) *PdptwSolver

func (*PdptwSolver) GetInterestMap

func (g *PdptwSolver) GetInterestMap() common.InterestMap

func (*PdptwSolver) GetRTH

func (g *PdptwSolver) GetRTH() []common.Location

func (*PdptwSolver) GetTravelTimeMatrixPath

func (g *PdptwSolver) GetTravelTimeMatrixPath() string

func (*PdptwSolver) New

func (g *PdptwSolver) New() Solver

func (*PdptwSolver) Set

func (g *PdptwSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location)

func (*PdptwSolver) SetInitialSchedule

func (g *PdptwSolver) SetInitialSchedule(s Schedule)

func (*PdptwSolver) SetInterestMap

func (g *PdptwSolver) SetInterestMap(im common.InterestMap)

func (*PdptwSolver) SetTravelTimeMatrixPath

func (g *PdptwSolver) SetTravelTimeMatrixPath(p string)

func (*PdptwSolver) Solve

func (g *PdptwSolver) Solve() Schedule

type RoiSolver

type RoiSolver struct {
	Alpha float64
	// contains filtered or unexported fields
}

roi (greedy) solver

func (*RoiSolver) GetInterestMap

func (r *RoiSolver) GetInterestMap() common.InterestMap

func (*RoiSolver) GetRTH

func (r *RoiSolver) GetRTH() bool

func (*RoiSolver) GetTravelTimeMatrixPath

func (r *RoiSolver) GetTravelTimeMatrixPath() string

func (*RoiSolver) Set

func (r *RoiSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, x bool)

func (*RoiSolver) SetInitialSchedule

func (r *RoiSolver) SetInitialSchedule(s Schedule)

func (*RoiSolver) SetInterestMap

func (r *RoiSolver) SetInterestMap(im common.InterestMap)

func (*RoiSolver) SetTravelTimeMatrixPath

func (r *RoiSolver) SetTravelTimeMatrixPath(p string)

func (*RoiSolver) Solve

func (r *RoiSolver) Solve() Schedule

compute schedule with ROI

type RoundRobinSolver

type RoundRobinSolver struct {
	// contains filtered or unexported fields
}

round-robin scheduler

func (*RoundRobinSolver) GetInterestMap

func (r *RoundRobinSolver) GetInterestMap() common.InterestMap

func (*RoundRobinSolver) GetRTH

func (r *RoundRobinSolver) GetRTH() []common.Location

func (*RoundRobinSolver) Set

func (r *RoundRobinSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, x []common.Location)

func (*RoundRobinSolver) SetInitialSchedule

func (r *RoundRobinSolver) SetInitialSchedule(s Schedule)

func (*RoundRobinSolver) SetInterestMap

func (r *RoundRobinSolver) SetInterestMap(im common.InterestMap)

func (*RoundRobinSolver) Solve

func (r *RoundRobinSolver) Solve() Schedule

type Route

type Route struct {
	Path          []common.TaskData `json:"path"`
	TotalInterest float64           `json:"total_interest"`
	TotalTime     int               `json:"total_time"`
	VehicleStart  common.Location   `json:"vehicle_start"`
	VehicleEnd    common.Location   `json:"vehicle_end"`
}

schema for route for a single vehicle in schedule

type Schedule

type Schedule struct {
	Routes     []Route    `json:"routes"`
	Allocation Allocation `json:"allocation"`
	Stats      struct {
		Weights map[int]float64 `json:"weights"`
		Alpha   float64         `json:"alpha"`
		Bound   float64         `json:"bound"`
	} `json:"stats"`
}

schema for schedule returned by VRP solver

func (Schedule) ElapsedTime

func (s Schedule) ElapsedTime() []int

func (Schedule) MaxTime

func (s Schedule) MaxTime() int

func (Schedule) String

func (s Schedule) String() string

func (*Schedule) Trim

func (s *Schedule) Trim(time int)

type Solver

type Solver interface {
	New() Solver
	Solve() Schedule
	SetInterestMap(common.InterestMap)
	GetInterestMap() common.InterestMap
	GetRTH() []common.Location
	SetInitialSchedule(Schedule)
	SetTravelTimeMatrixPath(string)
	GetTravelTimeMatrixPath() string
	Set(common.InterestMap, common.InterestMap, []common.Vehicle, int, int, []common.Location)
}

interface to VRP solvers

Jump to

Keyboard shortcuts

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