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: 0

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