solver

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package solver provides a library for solving a testbed reservation request against a given inventory of available devices and their connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignmentToReservation added in v0.12.3

func AssignmentToReservation(solveResult *SolveResult, tb *opb.Testbed) (*binding.Reservation, error)

AssignmentToReservation converts the solveResult to a binding.Reservation.

Types

type Inventory

type Inventory struct {
	DUTs  []binding.DUT
	ATEs  []binding.ATE
	Links map[*binding.Port]*binding.Port // Maps a port to its peer.
}

Inventory of available binding devices and links. This struct is provided by a specific binding implementation.

type SolveResult

type SolveResult struct {
	Assignment       *portgraph.Assignment
	AbsNode2Dev      map[*portgraph.AbstractNode]*opb.Device
	AbsPort2Port     map[*portgraph.AbstractPort]*opb.Port
	ConNode2BindDev  map[*portgraph.ConcreteNode]*binding.Device
	ConPort2BindPort map[*portgraph.ConcretePort]*binding.Port
}

SolveResult contains the result of a successful testbed solve.

func Solve

func Solve(ctx context.Context, tb *opb.Testbed, inv *Inventory, partial map[string]string) (*SolveResult, error)

Solve finds an assignment to the provided testbed from the given inventory. It returns the low-level portgraph.Assignment and maps to correlate graph elements back to the original binding and testbed elements.

Jump to

Keyboard shortcuts

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