runner

package
v0.0.0-...-8ad53de Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Width sets the width of the Grid
	Width int

	// Height sets the height of the Grid
	Height int

	// NFrames is the amount of frames that will be built
	NFrames int

	Simulation models.SimulationConfig
	Output     OutputConfig
	GIF        GIFConfig
}

Config holds configs for the simulation runner

type GIFConfig

type GIFConfig struct {
	// Delay units are 100th of a second
	Delay int
}

GIFConfig holds configurations specific to building a GIF

type OutputConfig

type OutputConfig struct {
	Path string
}

OutputConfig holds configs for the output of the simulation

type Runner

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

Runner is responsible for instantiating and running a simulation.

func New

func New(simType string, cfg Config) (Runner, error)

New creates a new instance for Runner

func (*Runner) Animate

func (r *Runner) Animate(g *models.Grid) ([]*image.Paletted, error)

Animate assembles all of the frames for the GIF

func (*Runner) CreateGIF

func (r *Runner) CreateGIF() (filepath string, err error)

CreateGIF creates the simulation

Jump to

Keyboard shortcuts

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