Documentation
¶
Overview ¶
Package run provides tools for running solvers. When `run.Run` is called by your application, the runner configured by the environment variable `NEXTMV_RUNNER` will be used. Valid values are `cli` (default) and `http`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run a solver via a handler.
func main() {
handler := func(v int, opt store.Options) (store.Solver, error) {
s := store.New()
x := store.NewVar(s, v)
s = s.Value(...).Format(...).Generate(...) // Modify the Store.
return s.Maximizer(opt), nil
// return s.Minimizer(opt), nil
// return s.Satisfier(opt), nil
}
run.Run(handler)
}
Types ¶
type Runner ¶ added in v0.20.4
type Runner interface {
// Run invokes a solver by invoking the associated handler.
Run()
// SetDecoder sets decoder to be used to decode input.
SetDecoder(decoder decode.Decoder)
// SetEncoder sets encoder to be used to encode output.
SetEncoder(encoder encode.Encoder)
// SetHandler sets the handler to be used by the run invocation.
SetHandler(any)
}
Runner defines the interface of the runner.
Click to show internal directories.
Click to hide internal directories.