jobsolver

package
v0.0.0-...-c5bc0ce Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckItem

type CheckItem struct {
	InputPath     string
	OutputPath    string
	ExcpectedPath string
	Verdict       ugrade.Verdict
	Err           error
}

CheckItem contains single testcase item with checking result.

type CheckSuite

type CheckSuite struct {
	Verdict ugrade.Verdict
	Items   []CheckItem
}

CheckSuite contains testcase suite checking result.

type Checker

type Checker interface {
	CheckSuite(
		ctx context.Context,
		spec ugrade.JobSpec,
		tcSuite TCSuite,
		submissionExec ExecutionResult,
	) (*CheckSuite, error)
}

Checker check correctness of contestant output.

type CompilationResult

type CompilationResult struct {
	// Usage contains information about memory and cpu usage when compiling.
	Usage ugrade.Usage

	// ExecDir contains path to generated executable directory. This path is relative to host filesystem
	ExecDir string

	// ExecName contains executable file name generated by compiler. Thus, the path to executable file
	// is `ExecDir`/`ExecName`
	ExecName string

	// RuntimeImage contains path to compressed sandbox image file that can be used to run the executable
	RuntimeImage string
}

CompilationResult represent compilation result.

type Compiler

type Compiler interface {
	Compile(ctx context.Context, source ugrade.SourceCode) (*CompilationResult, error)
}

Compiler compile source code and provide `CompilationResult`.

type ExecutionItem

type ExecutionItem struct {
	InputName  string
	OutputName string
	Usage      ugrade.Usage
	Err        error
}

ExecutionItem represent single execution of contestant submission.

type ExecutionResult

type ExecutionResult struct {
	Dir   string
	Items []ExecutionItem
}

ExecutionResult represent execution of contestant submission given testcase suite.

type Executor

type Executor interface {
	Execute(ctx context.Context, spec ugrade.JobSpec, tcSuite TCSuite) (*ExecutionResult, error)
}

Executor execute submission given testcase suite.

type TCGenerator

type TCGenerator interface {
	Generate(ctx context.Context, spec ugrade.JobSpec) (*TCSuite, error)
}

TCGenerator generate testcase suite

type TCItem

type TCItem struct {
	Input  string
	Output string
}

TCItem represent testcase input and expected output

type TCSuite

type TCSuite struct {
	MaxMemory uint64
	MaxCPU    time.Duration
	Tolerance float64
	Items     []TCItem
	Dir       string
}

TCSuite represent group of testcases

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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