Documentation ¶
Index ¶
- Constants
- func Dijkstra(g Graph, origin, destination int) ([]int, int)
- func WriteFmi(g Graph, filename string)
- type AdjacencyArrayGraph
- type AdjacencyListGraph
- func (alg *AdjacencyListGraph) AddEdge(e Edge)
- func (alg *AdjacencyListGraph) AddNode(n Node)
- func (alg *AdjacencyListGraph) EdgeCount() int
- func (alg *AdjacencyListGraph) GetEdgesFrom(id NodeId) []Edge
- func (alg *AdjacencyListGraph) GetNode(id NodeId) Node
- func (alg *AdjacencyListGraph) NodeCount() int
- type DynamicGraph
- type Edge
- type Graph
- type Node
- type NodeId
- type PriorityQueue
- type PriorityQueueItem
- type Route
- type ShipRouter
Constants ¶
View Source
const ( PARSE_NODE_COUNT = iota PARSE_EDGE_COUNT = iota PARSE_NODES = iota PARSE_EDGES = iota )
fmi parse states
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdjacencyArrayGraph ¶
Implementation for static graphs
func NewAdjacencyArrayFromFmi ¶
func NewAdjacencyArrayFromFmi(filename string) *AdjacencyArrayGraph
func NewAdjacencyArrayFromGraph ¶
func NewAdjacencyArrayFromGraph(g Graph) *AdjacencyArrayGraph
func (*AdjacencyArrayGraph) EdgeCount ¶
func (aag *AdjacencyArrayGraph) EdgeCount() int
func (*AdjacencyArrayGraph) GetEdgesFrom ¶
func (aag *AdjacencyArrayGraph) GetEdgesFrom(id NodeId) []Edge
func (*AdjacencyArrayGraph) GetNode ¶
func (aag *AdjacencyArrayGraph) GetNode(id NodeId) Node
func (*AdjacencyArrayGraph) NodeCount ¶
func (aag *AdjacencyArrayGraph) NodeCount() int
type AdjacencyListGraph ¶
type AdjacencyListGraph struct { Nodes []Node Edges [][]outgoingEdge // contains filtered or unexported fields }
Implementation for dynamic graphs
func NewAdjacencyListFromFmi ¶
func NewAdjacencyListFromFmi(filename string) *AdjacencyListGraph
func (*AdjacencyListGraph) AddEdge ¶
func (alg *AdjacencyListGraph) AddEdge(e Edge)
func (*AdjacencyListGraph) AddNode ¶
func (alg *AdjacencyListGraph) AddNode(n Node)
func (*AdjacencyListGraph) EdgeCount ¶
func (alg *AdjacencyListGraph) EdgeCount() int
func (*AdjacencyListGraph) GetEdgesFrom ¶
func (alg *AdjacencyListGraph) GetEdgesFrom(id NodeId) []Edge
func (*AdjacencyListGraph) GetNode ¶
func (alg *AdjacencyListGraph) GetNode(id NodeId) Node
func (*AdjacencyListGraph) NodeCount ¶
func (alg *AdjacencyListGraph) NodeCount() int
type DynamicGraph ¶
type PriorityQueue ¶
type PriorityQueue []*PriorityQueueItem
A PriorityQueue implements the heap.Interface and hold PriorityQueueItems
func (PriorityQueue) Len ¶
func (h PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (h PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (h *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (h *PriorityQueue) Push(item interface{})
func (PriorityQueue) Swap ¶
func (h PriorityQueue) Swap(i, j int)
type PriorityQueueItem ¶
type PriorityQueueItem struct {
// contains filtered or unexported fields
}
type ShipRouter ¶
type ShipRouter struct {
// contains filtered or unexported fields
}
func NewShipRouter ¶
func NewShipRouter(g Graph) *ShipRouter
func (ShipRouter) ComputeRoute ¶
func (sr ShipRouter) ComputeRoute(origin, destination geo.Point) (route Route)
Click to show internal directories.
Click to hide internal directories.