solver

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeppySolver

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

DeppySolver is a simple solver implementation that takes an entity source group and a constraint aggregator to produce a Solution (or error if no solution can be found)

func NewDeppySolver

func NewDeppySolver(entitySourceGroup *entitysource.Group, constraintAggregator *constraints.ConstraintAggregator) (*DeppySolver, error)

func (DeppySolver) Solve

func (d DeppySolver) Solve(ctx context.Context) (Solution, error)

type Solution

type Solution map[entitysource.EntityID]bool

Solution is returned by the Solver when a solution could be found it can be queried by EntityID to see if the entity was selected (true) or not (false) by the solver

type Solver

type Solver interface {
	Solve(ctx context.Context) (Solution, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳