base

package
v0.0.0-...-2efb1be Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultColLimitation = "limited"
View Source
const DefaultGeneration = 0
View Source
const DefaultGridType = "dok"
View Source
const DefaultNeighborhoodType = neighborhood.MOORE
View Source
const DefaultRowLimitation = "limited"
View Source
const DefaultRules = "23/3"

Variables

This section is empty.

Functions

func GetTestdataFilePath

func GetTestdataFilePath(filename string) (string, error)

GetTestdataFilePath : return the test data file path for the file name passed as argument.

Types

type GolConf

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

GolConf : configuration for Game of Life instances

func NewDefaultGolConf

func NewDefaultGolConf() *GolConf

NewDefaultGolConf : returns a default configuration for Game of Life instances

func NewGolConf

func NewGolConf(overwrittenAttrs map[string]interface{}) *GolConf

NewGolConf : returns a default configuration but overwritting the fields that are passed as a map

func (*GolConf) ColLimitation

func (gc *GolConf) ColLimitation() string

func (*GolConf) Generation

func (gc *GolConf) Generation() int

func (*GolConf) GridType

func (gc *GolConf) GridType() string

func (*GolConf) NeighborhoodType

func (gc *GolConf) NeighborhoodType() int

func (*GolConf) RowLimitation

func (gc *GolConf) RowLimitation() string

func (*GolConf) Rules

func (gc *GolConf) Rules() string

type GolInterface

type GolInterface interface {
	// Initializer of a Gol
	InitFromConf(name, description string, rows, cols int, gconf *GolConf)
	// Dummy-property methods
	Name() string
	Description() string
	// Row and cols related methods
	Rows() int
	Cols() int
	LimitRows() bool
	SetLimitRows(limitRows bool)
	LimitCols() bool
	SetLimitCols(limitCols bool)
	// Cloning
	Clone() GolInterface
	// Indexing methods
	Get(i int, j int) int
	Set(i int, j int, value int)
	SetAll(value int)
	// Rules methods
	Rules() string
	SetRules(rules string)
	// Debug methods
	DbgStdout()
	// Generation methods
	Generation() int
	SetGeneration(generation int)
	// Equality methods
	GridEquals(g GolInterface, mode string) bool
	Equals(g GolInterface) bool
	EqualsError(g GolInterface) error
	// NeighborhoodType-related methods
	NeighborhoodTypeString() string
	SetNeighborhoodType(neighborhoodType int)
	SetNeighborhoodTypeString(neighborhoodType string)
	// Concurrency-related methods
	Processes() int
	SetProcesses(processes int)
	ThreadPoolSize() int
	SetThreadPoolSize(threadPoolSize int)
	// Changes that can be applied at any moment
	// without calling nextGeneration
	ChangeCells(changes [][]int) GolInterface
	// FastForward a number of generations
	FastForward(generations int) GolInterface
	// Compute the next generation for a game of life instance
	NextGeneration() GolInterface
}

GolInterface : minimal Gol interface.

Jump to

Keyboard shortcuts

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