Documentation ¶
Index ¶
- Constants
- Variables
- func InServiceTime(cost TazCost, time float64) bool
- func StationTimeDependentCosts(cost float64, departureTimes []float64) []float64
- func TazCenterPoint(taz TazPair, xStep float64, yStep float64, xMin float64, yMin float64) geometry.Point
- func TazDistance(taz1 TazPair, taz2 TazPair, xStep float64, yStep float64) float64
- func TimeToIndex(time float64) int
- type BusEdgeAttr
- type BusNodeAttr
- type DriveEdgeAttr
- type DriveNodeAttr
- type IHeuristics
- type Item
- type PathItem
- type PriorityQueue
- type SearchGraph
- func (g *SearchGraph[NT, ET]) GetEdgeLength(from, to int, tIndex int) float64
- func (g *SearchGraph[NT, ET]) GetEdgeLengthAndAttr(from, to int, tIndex int) (float64, ET)
- func (g *SearchGraph[NT, ET]) InitEdge(from, to int, lengths []float64, attr ET)
- func (g *SearchGraph[NT, ET]) InitNode(p geometry.Point, attr NT, noOut bool) int
- func (g *SearchGraph[NT, ET]) SetEdgeLength(from, to int, tIndex int, length float64) error
- func (g *SearchGraph[NT, ET]) SetEdgeLengths(from, to int, lengths []float64) error
- func (g *SearchGraph[NT, ET]) ShortestPath(start, end int, curTime float64) ([]PathItem[NT, ET], float64)
- func (g *SearchGraph[NT, ET]) ShortestPathAStar(start, end int, curTime float64) ([]PathItem[NT, ET], float64)
- func (g *SearchGraph[NT, ET]) ShortestPathAStarToTaz(start int, endTaz TazPair, endP geometry.Point, sameTazDistance float64, ...) ([]PathItem[NT, ET], float64)
- func (g *SearchGraph[NT, ET]) ShortestTAZPath(start int, endTaz TazPair, endP geometry.Point, ...) ([]PathItem[NT, ET], float64)
- type TazCost
- type TazPair
- type WalkLaneNode
- type WalkNodeAttr
Constants ¶
View Source
const ( // // 行人、车辆、公交速度 // BUS_SPEED = 40 / 3.6 // 数值常量 FORWARD = 1 BACKWARD = 2 BUS = 4 // 道路头尾,与连接关系对应 HEAD = int(mapv2.LaneConnectionType_LANE_CONNECTION_TYPE_HEAD) TAIL = int(mapv2.LaneConnectionType_LANE_CONNECTION_TYPE_TAIL) // 道路边权的分辨率/s TIME_SLICE_INTERVAl = 300 // 道路边权时间片数 TIME_SLICE_LENGTH = 288 )
Variables ¶
Functions ¶
func StationTimeDependentCosts ¶ added in v1.8.0
func TazCenterPoint ¶ added in v1.8.0
func TazDistance ¶ added in v1.8.0
Types ¶
type BusEdgeAttr ¶ added in v1.8.0
type BusNodeAttr ¶ added in v1.8.0
type IHeuristics ¶ added in v1.8.0
type Item ¶
type Item struct { Value int // The value of the item; arbitrary. Priority float64 // The priority of the item in the queue. // The Index is needed by update and is maintained by the heap.Interface methods. Index int // The index of the item in the heap. }
An Item is something we manage in a priority queue.
type PriorityQueue ¶
type PriorityQueue []*Item
A PriorityQueue implements heap.Interface and holds Items.
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() any
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x any)
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
type SearchGraph ¶
func NewSearchGraph ¶
func NewSearchGraph[NT any, ET any](isTD bool, h IHeuristics[NT, ET]) *SearchGraph[NT, ET]
func (*SearchGraph[NT, ET]) GetEdgeLength ¶
func (g *SearchGraph[NT, ET]) GetEdgeLength(from, to int, tIndex int) float64
func (*SearchGraph[NT, ET]) GetEdgeLengthAndAttr ¶
func (g *SearchGraph[NT, ET]) GetEdgeLengthAndAttr(from, to int, tIndex int) (float64, ET)
func (*SearchGraph[NT, ET]) InitEdge ¶
func (g *SearchGraph[NT, ET]) InitEdge(from, to int, lengths []float64, attr ET)
func (*SearchGraph[NT, ET]) InitNode ¶
func (g *SearchGraph[NT, ET]) InitNode(p geometry.Point, attr NT, noOut bool) int
func (*SearchGraph[NT, ET]) SetEdgeLength ¶
func (g *SearchGraph[NT, ET]) SetEdgeLength(from, to int, tIndex int, length float64) error
func (*SearchGraph[NT, ET]) SetEdgeLengths ¶
func (g *SearchGraph[NT, ET]) SetEdgeLengths(from, to int, lengths []float64) error
func (*SearchGraph[NT, ET]) ShortestPath ¶
func (g *SearchGraph[NT, ET]) ShortestPath(start, end int, curTime float64) ([]PathItem[NT, ET], float64)
func (*SearchGraph[NT, ET]) ShortestPathAStar ¶
func (g *SearchGraph[NT, ET]) ShortestPathAStar(start, end int, curTime float64) ([]PathItem[NT, ET], float64)
A Star算法求最短路
type TazCost ¶ added in v1.8.0
type WalkLaneNode ¶ added in v1.8.0
Click to show internal directories.
Click to hide internal directories.