Documentation
¶
Index ¶
- Constants
- type Allocation
- type DedicatePdptwSolver
- func (d *DedicatePdptwSolver) GetInterestMap() common.InterestMap
- func (d *DedicatePdptwSolver) GetRTH() []common.Location
- func (d *DedicatePdptwSolver) GetTravelTimeMatrixPath() string
- func (d *DedicatePdptwSolver) New() Solver
- func (d *DedicatePdptwSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location)
- func (d *DedicatePdptwSolver) SetInitialSchedule(s Schedule)
- func (d *DedicatePdptwSolver) SetInterestMap(im common.InterestMap)
- func (d *DedicatePdptwSolver) SetTravelTimeMatrixPath(p string)
- func (d *DedicatePdptwSolver) Solve() Schedule
- type DedicateSolver
- func (d *DedicateSolver) GetInterestMap() common.InterestMap
- func (d *DedicateSolver) GetRTH() []common.Location
- func (d *DedicateSolver) GetTravelTimeMatrixPath() string
- func (d *DedicateSolver) New() Solver
- func (d *DedicateSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location)
- func (d *DedicateSolver) SetInitialSchedule(s Schedule)
- func (d *DedicateSolver) SetInterestMap(im common.InterestMap)
- func (d *DedicateSolver) SetTravelTimeMatrixPath(p string)
- func (d *DedicateSolver) Solve() Schedule
- type GoogleSolver
- func (g *GoogleSolver) GetInterestMap() common.InterestMap
- func (g *GoogleSolver) GetRTH() []common.Location
- func (g *GoogleSolver) GetTravelTimeMatrixPath() string
- func (g *GoogleSolver) New() Solver
- func (g *GoogleSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location)
- func (g *GoogleSolver) SetInitialSchedule(s Schedule)
- func (g *GoogleSolver) SetInterestMap(im common.InterestMap)
- func (g *GoogleSolver) SetTravelTimeMatrixPath(p string)
- func (g *GoogleSolver) Solve() Schedule
- type Input
- type PdptwSolver
- func (g *PdptwSolver) GetInterestMap() common.InterestMap
- func (g *PdptwSolver) GetRTH() []common.Location
- func (g *PdptwSolver) GetTravelTimeMatrixPath() string
- func (g *PdptwSolver) New() Solver
- func (g *PdptwSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, r []common.Location)
- func (g *PdptwSolver) SetInitialSchedule(s Schedule)
- func (g *PdptwSolver) SetInterestMap(im common.InterestMap)
- func (g *PdptwSolver) SetTravelTimeMatrixPath(p string)
- func (g *PdptwSolver) Solve() Schedule
- type RoiSolver
- func (r *RoiSolver) GetInterestMap() common.InterestMap
- func (r *RoiSolver) GetRTH() bool
- func (r *RoiSolver) GetTravelTimeMatrixPath() string
- func (r *RoiSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, x bool)
- func (r *RoiSolver) SetInitialSchedule(s Schedule)
- func (r *RoiSolver) SetInterestMap(im common.InterestMap)
- func (r *RoiSolver) SetTravelTimeMatrixPath(p string)
- func (r *RoiSolver) Solve() Schedule
- type RoundRobinSolver
- func (r *RoundRobinSolver) GetInterestMap() common.InterestMap
- func (r *RoundRobinSolver) GetRTH() []common.Location
- func (r *RoundRobinSolver) Set(im, uim common.InterestMap, v []common.Vehicle, b, c int, x []common.Location)
- func (r *RoundRobinSolver) SetInitialSchedule(s Schedule)
- func (r *RoundRobinSolver) SetInterestMap(im common.InterestMap)
- func (r *RoundRobinSolver) Solve() Schedule
- type Route
- type Schedule
- type Solver
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 ¶
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) GetTravelTimeMatrixPath ¶
func (*RoiSolver) SetInitialSchedule ¶
func (*RoiSolver) SetInterestMap ¶
func (r *RoiSolver) SetInterestMap(im common.InterestMap)
func (*RoiSolver) SetTravelTimeMatrixPath ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.