Documentation ¶
Index ¶
- type CellularAutomata
- func (s *CellularAutomata) AdvanceFrame(g *models.Grid) error
- func (s *CellularAutomata) DrawSpace(sp *models.Space, img *image.Paletted, x int, y int) error
- func (s *CellularAutomata) GetPalette() color.Palette
- func (s *CellularAutomata) InitializeGrid(g *models.Grid) error
- func (s *CellularAutomata) OutputName() (string, error)
- type CellularAutomataConfig
- type SlimeMold
- type SlimeMoldConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CellularAutomata ¶
type CellularAutomata struct {
// contains filtered or unexported fields
}
CellularAutomata simulates a scenario where cells in a 2-dimensional world can hunt and eat each other based on a set of simple parameters.
func NewCellularAutomata ¶
func NewCellularAutomata(cfg models.SimulationConfig) (*CellularAutomata, error)
NewCellularAutomata initializes and returns a new cellular automata simulation
func (*CellularAutomata) AdvanceFrame ¶
func (s *CellularAutomata) AdvanceFrame(g *models.Grid) error
AdvanceFrame determines and assigns the next state of each organism's parameters.
func (*CellularAutomata) DrawSpace ¶
DrawSpace colors the image at the specified location according to the properties of the Space.
func (*CellularAutomata) GetPalette ¶
func (s *CellularAutomata) GetPalette() color.Palette
GetPalette returns the simulation's color palette
func (*CellularAutomata) InitializeGrid ¶
func (s *CellularAutomata) InitializeGrid(g *models.Grid) error
InitializeGrid instantiates a grid
func (*CellularAutomata) OutputName ¶
func (s *CellularAutomata) OutputName() (string, error)
OutputName creates an output file path based on parameters of the simulation
type CellularAutomataConfig ¶
type CellularAutomataConfig struct {
// contains filtered or unexported fields
}
CellularAutomataConfig holds the configurations for the cellular automata simulation
type SlimeMold ¶
type SlimeMold struct {
// contains filtered or unexported fields
}
SlimeMold simulates a slime mold that leaves behind scent trails and creates networks based on where other mold particles have been.
func NewSlimeMold ¶
func NewSlimeMold(cfg models.SimulationConfig) (*SlimeMold, error)
NewSlimeMold initializes and returns a new slime mold simulation
func (*SlimeMold) AdvanceFrame ¶
AdvanceFrame determines and assigns the next state of each organism's parameters.
func (*SlimeMold) DrawSpace ¶
DrawSpace colors the image at the specified location according to the properties of the Space.
func (*SlimeMold) GetPalette ¶
GetPalette returns the simulation's color palette
func (*SlimeMold) InitializeGrid ¶
InitializeGrid instantiates a grid
func (*SlimeMold) OutputName ¶
OutputName creates an output file path based on parameters of the simulation
type SlimeMoldConfig ¶
type SlimeMoldConfig struct {
// contains filtered or unexported fields
}
SlimeMoldConfig holds the configurations for the slime mold simulation