executor

package
v0.0.0-...-80c8c53 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Custom

type Custom struct {
	Path      string
	Optimizer optimizer.PerformanceSubjectOptimizer
}

Custom is an Executor that allows for running optimization using the custom, self-written optimizer.

func (*Custom) CacheEligible

func (c *Custom) CacheEligible() bool

func (*Custom) Execute

func (c *Custom) Execute(ctx context.Context) (int, error)

Execute runs optimization using custom optimizer and waits for results or context cancellation.

func (*Custom) Identifier

func (c *Custom) Identifier() string

Identifier returns the name of the executor, which in this case is also the name of the underlying optimizer.

type Dummy

type Dummy struct {
	Name   string
	Result int
}

func (*Dummy) CacheEligible

func (d *Dummy) CacheEligible() bool

func (*Dummy) Execute

func (d *Dummy) Execute(_ context.Context) (int, error)

func (*Dummy) Identifier

func (d *Dummy) Identifier() string

type Executor

type Executor interface {
	behavior.Identifiable
	behavior.Cacheable
	Execute(ctx context.Context) (int, error)
}

func NewCplex

func NewCplex(modelFilepath, dataFilepath string) Executor

NewCplex returns Executor which is able to run cplex optimization process and obtain results from it.

func NewCplexWithThreadPool

func NewCplexWithThreadPool(modelFilepath, dataFilepath string, threadPoolLimit uint) Executor

NewCplexWithThreadPool returns Executor which is able to run cplex optimization process and obtain results from it. It limits the thread count of the CPLEX process, so it is convenient in cases when several CPLEX processes run on one machine to avoid excessive context switching.

func NewCustom

func NewCustom(path string, optimizer optimizer.PerformanceSubjectOptimizer) Executor

type GroupExecutor

type GroupExecutor struct {
	Executors []Executor
}

func (*GroupExecutor) Execute

func (ge *GroupExecutor) Execute(ctx context.Context) <-chan *Result

type Process

type Process interface {
	Output() ([]byte, error)
}

Process represents an external process.

type Result

type Result struct {
	Executor
	Value int
	Err   error
}

Jump to

Keyboard shortcuts

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