solver

package
v0.0.0-...-1a4cfde Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

The solver package provides a Golang interface to Minizinc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model represents a Minizinc model.

func NewModel

func NewModel(mzn string) *Model

NewModel returns a pointer to a new model.

func (*Model) Compile

func (m *Model) Compile() error

Compile translates a model to its Flatzinc representation.

func (*Model) Flatzinc

func (m *Model) Flatzinc() string

Flatzinc returns the compiled Flatzinc representation of the model.

func (*Model) Minizinc

func (m *Model) Minizinc() string

Minizinc returns the original Minizinc representation of the model.

func (*Model) Solve

func (m *Model) Solve(solution interface{}, timeout int) (SolutionStatus, error)

Solve runs the solver on the compiled model and tries to retrieve a solution.

type SolutionStatus

type SolutionStatus int

SolutionStatus qualifies the solution returned by the solver.

const (
	SolutionComplete SolutionStatus = iota
	SolutionError
	SolutionUnknown
	SolutionUnbounded
	SolutionUnsatUnbounded
	SolutionUnsat
	SolutionIncomplete
)

Jump to

Keyboard shortcuts

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