spmetric

package
v0.0.0-...-ba940be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const SP_ITERATIONS = 100
View Source
const SP_MAX_DISTANCE = 2048
View Source
const SP_RADIUS = 512

Variables

This section is empty.

Functions

func ComputeFrechetDistance

func ComputeFrechetDistance(a []common.Point, b []common.Point) float64

Compute the Frechet distance between two paths. Paths are represented by the sequence of points along the path. We assume straight

line between successive points.

func SPMetric

func SPMetric(a NodePathsGraph, b NodePathsGraph, prefix string, showA bool) (float64, float64, float64)

func SamplePath

func SamplePath(graph *common.Graph) []*common.Node

Types

type GraphPath

type GraphPath struct {
	Start common.EdgePos
	Path  []*common.Node
	End   common.EdgePos
}

func GetClosestPath

func GetClosestPath(graph NodePathsGraph, path []common.Point, radius float64) (*GraphPath, float64)

Find the path in graph with minimum Frechet distance to the given path, along with the associated Frechet distance.

type NodePaths

type NodePaths struct {
	Backpointers map[int]int     `json:"backpointers"`
	Distances    map[int]float64 `json:"distances"`
}

type NodePathsGraph

type NodePathsGraph struct {
	Graph     *common.Graph
	NodePaths map[int]NodePaths
}

func ReadNodePathsGraph

func ReadNodePathsGraph(fname string) (NodePathsGraph, error)

func (NodePathsGraph) GetShortestPath

func (g NodePathsGraph) GetShortestPath(src *common.Node, dst *common.Node, maxDistance float64) []*common.Node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL