solver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeppySolver

type DeppySolver struct{}

DeppySolver is a simple solver implementation that takes a slice of variables to produce a Solution (or error if no solution can be found)

func NewDeppySolver

func NewDeppySolver() *DeppySolver

func (DeppySolver) Solve

func (d DeppySolver) Solve(vars []deppy.Variable) (*Solution, error)

type Solution

type Solution struct {
	// contains filtered or unexported fields
}

Solution is returned by the Solver when the internal solver executed successfully. A successful execution of the solver can still end in an error when no solution can be found.

func (*Solution) Error

func (s *Solution) Error() error

Error returns the resolution error in case the problem is unsat on successful resolution, it will return nil

func (*Solution) IsSelected

func (s *Solution) IsSelected(identifier deppy.Identifier) bool

IsSelected returns true if the variable identified by the identifier was selected in the solution by the resolver. It will return false otherwise.

func (*Solution) SelectedVariables

func (s *Solution) SelectedVariables() map[deppy.Identifier]deppy.Variable

SelectedVariables returns the variables that were selected by the solver as part of the solution

Jump to

Keyboard shortcuts

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