Documentation
¶
Index ¶
- Constants
- func GraphAsString(g Graph) string
- func WriteFmi(g Graph, filename string)
- type AdjacencyArrayGraph
- func (aag *AdjacencyArrayGraph) ArcCount() int
- func (aag *AdjacencyArrayGraph) AsString() string
- func (aag *AdjacencyArrayGraph) GetArcsFrom(id NodeId) []Arc
- func (aag *AdjacencyArrayGraph) GetNode(id NodeId) *geo.Point
- func (aag *AdjacencyArrayGraph) GetNodes() []geo.Point
- func (aag *AdjacencyArrayGraph) NodeCount() int
- func (aag *AdjacencyArrayGraph) SetArcFlags(id NodeId, flag bool)
- func (aag *AdjacencyArrayGraph) SortArcs()
- type AdjacencyListGraph
- func (alg *AdjacencyListGraph) AddArc(from, to NodeId, distance int) bool
- func (alg *AdjacencyListGraph) AddNode(n geo.Point)
- func (alg *AdjacencyListGraph) ArcCount() int
- func (alg *AdjacencyListGraph) AsString() string
- func (alg *AdjacencyListGraph) GetArcsFrom(id NodeId) []Arc
- func (alg *AdjacencyListGraph) GetNode(id NodeId) *geo.Point
- func (alg *AdjacencyListGraph) GetNodes() []geo.Point
- func (alg *AdjacencyListGraph) NodeCount() int
- func (alg *AdjacencyListGraph) SetArcFlags(id NodeId, flag bool)
- func (alg *AdjacencyListGraph) SortArcs()
- type Arc
- type Arcs
- type DynamicGraph
- type Edge
- type Graph
- type NodeId
Constants ¶
const ( PARSE_NODE_COUNT = iota PARSE_EDGE_COUNT = iota PARSE_NODES = iota PARSE_EDGES = iota )
fmi parse states
Variables ¶
This section is empty.
Functions ¶
func GraphAsString ¶
Types ¶
type AdjacencyArrayGraph ¶
type AdjacencyArrayGraph struct { Nodes []geo.Point Offsets []int // contains filtered or unexported fields }
Implementation for static graphs
func NewAdjacencyArrayFromFmiFile ¶
func NewAdjacencyArrayFromFmiFile(filename string) *AdjacencyArrayGraph
func NewAdjacencyArrayFromFmiString ¶
func NewAdjacencyArrayFromFmiString(fmi string) *AdjacencyArrayGraph
func NewAdjacencyArrayFromGraph ¶
func NewAdjacencyArrayFromGraph(g Graph) *AdjacencyArrayGraph
Create an AdjacencyArrayGraph from the given graph
func (*AdjacencyArrayGraph) ArcCount ¶
func (aag *AdjacencyArrayGraph) ArcCount() int
Returns the total number of arcs in the graph
func (*AdjacencyArrayGraph) AsString ¶
func (aag *AdjacencyArrayGraph) AsString() string
Returns a human readable string of the graph
func (*AdjacencyArrayGraph) GetArcsFrom ¶
func (aag *AdjacencyArrayGraph) GetArcsFrom(id NodeId) []Arc
Get the Arcs for the given node id
func (*AdjacencyArrayGraph) GetNode ¶
func (aag *AdjacencyArrayGraph) GetNode(id NodeId) *geo.Point
Get the node for the given id
func (*AdjacencyArrayGraph) GetNodes ¶
func (aag *AdjacencyArrayGraph) GetNodes() []geo.Point
get all nodes of the graph
func (*AdjacencyArrayGraph) NodeCount ¶
func (aag *AdjacencyArrayGraph) NodeCount() int
Returns the number of Nodes in the graph
func (*AdjacencyArrayGraph) SetArcFlags ¶
func (aag *AdjacencyArrayGraph) SetArcFlags(id NodeId, flag bool)
Set the arc flags for all arcs of the given node
func (*AdjacencyArrayGraph) SortArcs ¶
func (aag *AdjacencyArrayGraph) SortArcs()
type AdjacencyListGraph ¶
type AdjacencyListGraph struct { Nodes []geo.Point // The nodes of the graph Edges [][]Arc // The Arcs of the graph. The first slice specifies to which the arc belongs // contains filtered or unexported fields }
Implementation for dynamic graphs
func NewAdjacencyListFromFmiFile ¶
func NewAdjacencyListFromFmiFile(filename string) *AdjacencyListGraph
func NewAdjacencyListFromFmiString ¶
func NewAdjacencyListFromFmiString(fmi string) *AdjacencyListGraph
func (*AdjacencyListGraph) AddArc ¶
func (alg *AdjacencyListGraph) AddArc(from, to NodeId, distance int) bool
Add an arc to the graph, going from source to target with the given distance
func (*AdjacencyListGraph) AddNode ¶
func (alg *AdjacencyListGraph) AddNode(n geo.Point)
Add a node to the graph
func (*AdjacencyListGraph) ArcCount ¶
func (alg *AdjacencyListGraph) ArcCount() int
Return the numebr of total arcs
func (*AdjacencyListGraph) AsString ¶
func (alg *AdjacencyListGraph) AsString() string
Return a human readable string of the graph
func (*AdjacencyListGraph) GetArcsFrom ¶
func (alg *AdjacencyListGraph) GetArcsFrom(id NodeId) []Arc
Get the arcs for the given node
func (*AdjacencyListGraph) GetNode ¶
func (alg *AdjacencyListGraph) GetNode(id NodeId) *geo.Point
Return the node for the given id
func (*AdjacencyListGraph) GetNodes ¶
func (alg *AdjacencyListGraph) GetNodes() []geo.Point
Return all nodes of the graph
func (*AdjacencyListGraph) NodeCount ¶
func (alg *AdjacencyListGraph) NodeCount() int
Return the number of total nodes
func (*AdjacencyListGraph) SetArcFlags ¶
func (alg *AdjacencyListGraph) SetArcFlags(id NodeId, flag bool)
Set the arc flags for all arcs of the given node
func (*AdjacencyListGraph) SortArcs ¶
func (alg *AdjacencyListGraph) SortArcs()