Documentation
¶
Index ¶
- Variables
- type Client
- type Job
- func (j *Job) SetDelivery(d []int) *Job
- func (j *Job) SetLocationId(locationId int) *Job
- func (j *Job) SetMeasuredDelivery(m Measurement, val int) *Job
- func (j *Job) SetMeasuredPickup(m Measurement, val int) *Job
- func (j *Job) SetPickup(p []int) *Job
- func (j *Job) SetPriority(p int) *Job
- func (j *Job) SetSkills(s []int) *Job
- func (j *Job) SetTimeWindows(tw [][]int) *Job
- type Location
- type Measurement
- type Problem
- func (p *Problem) AddJob(j *Job) *Problem
- func (p *Problem) AddShipment(s *Shipment) *Problem
- func (p *Problem) AddVehicle(v *Vehicle) *Problem
- func (p *Problem) Err() error
- func (p *Problem) FillLocations(locationResolver func(locationID int) Location) bool
- func (p *Problem) GetLocation(id int) (loc Location, err error)
- func (p *Problem) GetMeasurementIndex(measurement Measurement) int
- func (p *Problem) NewJob(id ...int) *Job
- func (p *Problem) NewShipment(id ...int) *Shipment
- func (p *Problem) NewVehicle(id ...int) *Vehicle
- func (p *Problem) NextJobId() (id int)
- func (p *Problem) SetCapacity(measurement Measurement, val int, capacities []int) []int
- type Route
- type RouteStep
- type Shipment
- func (s *Shipment) SetAmount(a []int) *Shipment
- func (s *Shipment) SetDeliveryLocationId(locationId int) *Shipment
- func (s *Shipment) SetMeasuredAmount(m Measurement, val int) *Shipment
- func (s *Shipment) SetPickupLocationId(locationId int) *Shipment
- func (s *Shipment) SetPriority(p int) *Shipment
- func (s *Shipment) SetSkills(skills []int) *Shipment
- type ShipmentStep
- func (ss *ShipmentStep) SetDescription(d string) *ShipmentStep
- func (ss *ShipmentStep) SetLocation(l *Location) *ShipmentStep
- func (ss *ShipmentStep) SetLocationIndex(idx int) *ShipmentStep
- func (ss *ShipmentStep) SetService(s int) *ShipmentStep
- func (ss *ShipmentStep) SetSetup(s int) *ShipmentStep
- func (ss *ShipmentStep) SetTimeWindows(tw [][]int) *ShipmentStep
- type Solution
- type Summary
- type Vehicle
- func (v *Vehicle) SetBreaks(b []int) *Vehicle
- func (v *Vehicle) SetCapacity(c []int) *Vehicle
- func (v *Vehicle) SetCosts(c []int) *Vehicle
- func (v *Vehicle) SetDescription(d string) *Vehicle
- func (v *Vehicle) SetEnd(l *Location) *Vehicle
- func (v *Vehicle) SetEndId(locationId int) *Vehicle
- func (v *Vehicle) SetEndIndex(idx int) *Vehicle
- func (v *Vehicle) SetMeasuredCapacity(m Measurement, val int) *Vehicle
- func (v *Vehicle) SetProfile(p VehicleProfile) *Vehicle
- func (v *Vehicle) SetSkills(s []int) *Vehicle
- func (v *Vehicle) SetStart(l *Location) *Vehicle
- func (v *Vehicle) SetStartId(locationId int) *Vehicle
- func (v *Vehicle) SetStartIndex(idx int) *Vehicle
- func (v *Vehicle) SetTimeWindow(tw []int) *Vehicle
- type VehicleProfile
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLocationNotDefined = errors.New("location is not defined")
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
//Id int `json:"id"`
//Description string `json:"description"`
//Location *Location `json:"location"`
//LocationIndex *int `json:"location_index"`
//locationID int
//Setup int `json:"setup"`
//Service int `json:"service"`
ShipmentStep
TimeWindows [][]int `json:"time_windows,omitempty"`
Delivery []int `json:"delivery,omitempty"`
Pickup []int `json:"pickup,omitempty"`
Skills []int `json:"skills,omitempty"`
Priority int `json:"priority"`
// contains filtered or unexported fields
}
func (*Job) SetDelivery ¶
func (*Job) SetLocationId ¶
func (*Job) SetMeasuredDelivery ¶
func (j *Job) SetMeasuredDelivery(m Measurement, val int) *Job
func (*Job) SetMeasuredPickup ¶
func (j *Job) SetMeasuredPickup(m Measurement, val int) *Job
func (*Job) SetPriority ¶
func (*Job) SetTimeWindows ¶
type Measurement ¶
type Measurement int
const ( MeasVolume Measurement = iota MeasWeight MeasAre MeasPLL )
type Problem ¶
type Problem struct {
Vehicles []*Vehicle `json:"vehicles"`
Jobs []*Job `json:"jobs,omitempty"`
Shipments []*Shipment `json:"shipments,omitempty"`
// contains filtered or unexported fields
}
func (*Problem) AddShipment ¶
func (*Problem) AddVehicle ¶
func (*Problem) FillLocations ¶
func (*Problem) GetMeasurementIndex ¶
func (p *Problem) GetMeasurementIndex(measurement Measurement) int
func (*Problem) NewShipment ¶
func (*Problem) NewVehicle ¶
func (*Problem) SetCapacity ¶
func (p *Problem) SetCapacity(measurement Measurement, val int, capacities []int) []int
type Route ¶
type Route struct {
Vehicle int `json:"vehicle"`
Cost int `json:"cost"`
Delivery []int `json:"delivery"`
Pickup []int `json:"pickup"`
Setup int `json:"setup"`
Service int `json:"service"`
Duration int `json:"duration"`
WaitingTime int `json:"waiting_time"`
Priority int `json:"priority"`
Distance int `json:"distance"`
Steps []RouteStep `json:"steps"`
Violations []interface{} `json:"violations"`
Geometry string `json:"geometry"`
}
type RouteStep ¶
type RouteStep struct {
Type string `json:"type"`
Location []float64 `json:"location,omitempty"`
Setup int `json:"setup"`
Service int `json:"service"`
WaitingTime int `json:"waiting_time"`
Load []int `json:"load"`
Arrival int `json:"arrival"`
Duration int `json:"duration"`
Violations []interface{} `json:"violations"`
Distance int `json:"distance"`
Id int `json:"id,omitempty"`
Job int `json:"job,omitempty"`
}
type Shipment ¶
type Shipment struct {
Pickup ShipmentStep `json:"pickup"`
Delivery ShipmentStep `json:"delivery"`
Amount []int `json:"amount,omitempty"`
Skills []int `json:"skills,omitempty"`
Priority int `json:"priority"`
// contains filtered or unexported fields
}
func (*Shipment) SetDeliveryLocationId ¶
func (*Shipment) SetMeasuredAmount ¶
func (s *Shipment) SetMeasuredAmount(m Measurement, val int) *Shipment
func (*Shipment) SetPickupLocationId ¶
func (*Shipment) SetPriority ¶
type ShipmentStep ¶
type ShipmentStep struct {
Id int `json:"id"`
Description string `json:"description,omitempty"`
Location *Location `json:"location,omitempty"`
LocationIndex *int `json:"location_index,omitempty"`
Setup int `json:"setup,omitempty"`
Service int `json:"service,omitempty"`
TimeWindows [][]int `json:"time_windows,omitempty"`
// contains filtered or unexported fields
}
func (*ShipmentStep) SetDescription ¶
func (ss *ShipmentStep) SetDescription(d string) *ShipmentStep
func (*ShipmentStep) SetLocation ¶
func (ss *ShipmentStep) SetLocation(l *Location) *ShipmentStep
func (*ShipmentStep) SetLocationIndex ¶
func (ss *ShipmentStep) SetLocationIndex(idx int) *ShipmentStep
func (*ShipmentStep) SetService ¶
func (ss *ShipmentStep) SetService(s int) *ShipmentStep
func (*ShipmentStep) SetSetup ¶
func (ss *ShipmentStep) SetSetup(s int) *ShipmentStep
func (*ShipmentStep) SetTimeWindows ¶
func (ss *ShipmentStep) SetTimeWindows(tw [][]int) *ShipmentStep
type Summary ¶
type Summary struct {
Cost int `json:"cost"`
Routes int `json:"routes"`
Unassigned int `json:"unassigned"`
Delivery []int `json:"delivery"`
Pickup []int `json:"pickup"`
Setup int `json:"setup"`
Service int `json:"service"`
Duration int `json:"duration"`
WaitingTime int `json:"waiting_time"`
Priority int `json:"priority"`
Distance int `json:"distance"`
Violations []interface{} `json:"violations"`
}
type Vehicle ¶
type Vehicle struct {
Id int `json:"id"`
Profile VehicleProfile `json:"profile,omitempty"`
Description string `json:"description,omitempty"`
Start *Location `json:"start,omitempty"`
StartIndex *int `json:"start_index,omitempty"`
End *Location `json:"end,omitempty"`
EndIndex *int `json:"end_index,omitempty"`
Capacity []int `json:"capacity,omitempty"`
Costs []int `json:"costs,omitempty"`
Skills []int `json:"skills,omitempty"`
TimeWindow []int `json:"time_window,omitempty"`
Breaks []int `json:"breaks,omitempty"`
// contains filtered or unexported fields
}
func (*Vehicle) SetCapacity ¶
func (*Vehicle) SetDescription ¶
func (*Vehicle) SetEndIndex ¶
func (*Vehicle) SetMeasuredCapacity ¶
func (v *Vehicle) SetMeasuredCapacity(m Measurement, val int) *Vehicle
func (*Vehicle) SetProfile ¶
func (v *Vehicle) SetProfile(p VehicleProfile) *Vehicle
func (*Vehicle) SetStartId ¶
func (*Vehicle) SetStartIndex ¶
func (*Vehicle) SetTimeWindow ¶
Click to show internal directories.
Click to hide internal directories.