path_selection

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const FUNCTIONAL_WEIGHT = 100000
View Source
const GLUE_WEIGHT = 100
View Source
const PHANTOM_PREFIX = "phantom$"

PHANTOM_PREFIX deliberately uses an invalid character so if it leaks into an actual input/output, it will fail to parse.

Variables

View Source
var (
	SkipPathErr = errors.New("skip path")
)

Functions

func BuildPathSelectionGraph

func BuildPathSelectionGraph(
	ctx context.Context,
	dep construct.SimpleEdge,
	kb knowledgebase.TemplateKB,
	classification string,
	ignoreDirectEdge bool,
) (construct.Graph, error)

func CalculateEdgeWeight

func CalculateEdgeWeight(
	dep construct.SimpleEdge,
	source, target construct.ResourceId,
	divideSourceBy, divideTargetBy int,
	classification string,
	kb knowledgebase.TemplateKB,
) int

func ClassPaths

func ClassPaths(
	kb knowledgebase.Graph,
	start, end string,
	classification string,
	cb func([]string) error,
) error

func GetPaths

func GetPaths(
	sol solution.Solution,
	source, target construct.ResourceId,
	pathValidityChecks func(source, target construct.ResourceId, path construct.Path) bool,
	hasPathCheck bool,
) ([]construct.Path, error)

Types

type EdgeExpand

type EdgeExpand struct {
	Ctx solution.Solution
}

func (*EdgeExpand) ExpandEdge

func (e *EdgeExpand) ExpandEdge(
	input ExpansionInput,
) (ExpansionResult, error)

type EdgeExpander

type EdgeExpander interface {
	ExpandEdge(input ExpansionInput) (ExpansionResult, error)
}

type ExpansionInput

type ExpansionInput struct {
	ExpandEdge       construct.SimpleEdge
	SatisfactionEdge construct.ResourceEdge
	Classification   string
	TempGraph        construct.Graph
}

func DeterminePathSatisfactionInputs

func DeterminePathSatisfactionInputs(
	sol solution.Solution,
	satisfaction knowledgebase.EdgePathSatisfaction,
	edge construct.ResourceEdge,
) (expansions []ExpansionInput, errs error)

type ExpansionResult

type ExpansionResult struct {
	Edges []graph.Edge[construct.ResourceId]
	Graph construct.Graph
}

Jump to

Keyboard shortcuts

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