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 ¶
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 ¶
NewGolConf : returns a default configuration but overwritting the fields that are passed as a map
func (*GolConf) ColLimitation ¶
func (*GolConf) Generation ¶
func (*GolConf) NeighborhoodType ¶
func (*GolConf) RowLimitation ¶
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.
Click to show internal directories.
Click to hide internal directories.