models

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2016 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknown = errors.New("unknown model")

ErrUnknown is used when a model could not be found.

Functions

This section is empty.

Types

type ModelExperimentInput

type ModelExperimentInput struct {
	IdentifierParams struct {
		Name      string  `json:"name"`
		From      float64 `json:"from"`
		To        float64 `json:"to"`
		Increment float64 `json:"increment"`
	} `json:"identifier"`
	MaxIterations *uint    `json:"maxIterations"`
	Tolerance     *float64 `json:"tolerance"`
}

type ModelSolutionInput

type ModelSolutionInput struct {
	MaxIterations     *uint                  `json:"maxIterations,omitempty"`
	Tolerance         *float64               `json:"tolerance,omitempty"`
	CustomIdentifiers map[string]interface{} `json:"customIdentifiers,omitempty"`
}

type Repository

type Repository interface {
	Store(model *SanModel) error
	Find(id SanModelID) (*SanModel, error)
	All() ([]*SanModel, error)
}

type SanModel

type SanModel struct {
	ID              SanModelID
	Name            string
	Title           string
	Description     string
	Source          string
	Hash            string
	TransitionsHash string
	ParsedModel     *sanmodel.Model
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

type SanModelID

type SanModelID string

func NextSanModelID

func NextSanModelID() SanModelID

type Service

type Service interface {
	Create(input *UpsertInput) (SanModelID, error)
	Find(id SanModelID) (*SanModel, error)
	Update(id SanModelID, input *UpsertInput) (*SanModel, error)
	All() ([]*SanModel, error)
	RenderGraph(id SanModelID, out io.Writer) error
	ScheduleSolution(id SanModelID, req *ModelSolutionInput) (*solver.Solution, error)
	FindSolution(id SanModelID, solutionID solver.SolutionID) (*solver.Solution, error)
	ScheduleExperiment(id SanModelID, req *ModelExperimentInput) (*solver.Experiment, error)
	FindExperiment(id SanModelID, experimentID solver.ExperimentID) (*solver.Experiment, error)
}

func NewService

func NewService(repo Repository, compiler compiler.Service, renderer renderer.Service, solver solver.Service) Service

type UpsertInput

type UpsertInput struct {
	Source      *string `json:"source"`
	Title       *string `json:"title"`
	Description *string `json:"description"`
}

Jump to

Keyboard shortcuts

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