Documentation ¶
Overview ¶
Package evolution provides an evolutionary model of grazer behavior.
Index ¶
- Variables
- func Run()
- type Activity
- type Age
- type Color
- type Energy
- type Genotype
- type Grass
- type GrasserCount
- type Heading
- type MouseSelection
- type Phenotype
- type Position
- type SelectionEntry
- type SysDecisions
- type SysDisturbance
- type SysGrazing
- type SysGrowGrassLinear
- type SysGrowGrassLogistic
- type SysInitEntities
- type SysInitGrass
- type SysMetabolism
- type SysMortality
- type SysReproduction
- type SysSearching
- type UISysDrawEntities
- type UISysDrawGrass
- type UISysDrawScatter
- type UISysManagePause
Constants ¶
This section is empty.
Variables ¶
var GeneNames = [7]string{
"MaxAngle",
"MinGrass",
"Invest",
"Offspring",
"Red",
"Green",
"Blue",
}
GeneNames for plotting.
Functions ¶
Types ¶
type MouseSelection ¶
type MouseSelection struct {
Selections []*SelectionEntry
}
MouseSelection resource.
type SelectionEntry ¶
SelectionEntry for MouseSelection.
type SysDecisions ¶
type SysDecisions struct {
// contains filtered or unexported fields
}
SysDecisions is a system to perform grazer decisions.
func (*SysDecisions) Finalize ¶
func (s *SysDecisions) Finalize(world *ecs.World)
Finalize the system
func (*SysDecisions) Initialize ¶
func (s *SysDecisions) Initialize(world *ecs.World)
Initialize the system
type SysDisturbance ¶
type SysDisturbance struct { Interval int Count int MinRadius int MaxRadius int TargetValue float32 // contains filtered or unexported fields }
SysDisturbance is a system that applies disturbances.
func (*SysDisturbance) Finalize ¶
func (s *SysDisturbance) Finalize(world *ecs.World)
Finalize the system
func (*SysDisturbance) Initialize ¶
func (s *SysDisturbance) Initialize(world *ecs.World)
Initialize the system
type SysGrazing ¶
type SysGrazing struct { MaxUptake float32 UptakeFactor float32 // contains filtered or unexported fields }
SysGrazing is a system that handle grazing of entities on Grass.
func (*SysGrazing) Initialize ¶
func (s *SysGrazing) Initialize(world *ecs.World)
Initialize the system
type SysGrowGrassLinear ¶
type SysGrowGrassLinear struct { Interval int BaseRate float32 // contains filtered or unexported fields }
SysGrowGrassLinear is a system to grow the Grass resource.
func (*SysGrowGrassLinear) Finalize ¶
func (s *SysGrowGrassLinear) Finalize(world *ecs.World)
Finalize the system
func (*SysGrowGrassLinear) Initialize ¶
func (s *SysGrowGrassLinear) Initialize(world *ecs.World)
Initialize the system
func (*SysGrowGrassLinear) Update ¶
func (s *SysGrowGrassLinear) Update(world *ecs.World)
Update the system
type SysGrowGrassLogistic ¶
type SysGrowGrassLogistic struct { Interval int BaseRate float32 // contains filtered or unexported fields }
SysGrowGrassLogistic is a system to grow the Grass resource.
func (*SysGrowGrassLogistic) Finalize ¶
func (s *SysGrowGrassLogistic) Finalize(world *ecs.World)
Finalize the system
func (*SysGrowGrassLogistic) Initialize ¶
func (s *SysGrowGrassLogistic) Initialize(world *ecs.World)
Initialize the system
func (*SysGrowGrassLogistic) Update ¶
func (s *SysGrowGrassLogistic) Update(world *ecs.World)
Update the system
type SysInitEntities ¶
type SysInitEntities struct { InitialBatches int ReleaseInterval int ReleaseBatches int BatchSize int RandomGenes bool // contains filtered or unexported fields }
SysInitEntities is a system to initialize entities.
func (*SysInitEntities) Finalize ¶
func (s *SysInitEntities) Finalize(world *ecs.World)
Finalize the system
func (*SysInitEntities) Initialize ¶
func (s *SysInitEntities) Initialize(world *ecs.World)
Initialize the system
func (*SysInitEntities) Update ¶
func (s *SysInitEntities) Update(world *ecs.World)
Update the system
type SysInitGrass ¶
SysInitGrass is a system to initialize the Grass resource.
func (*SysInitGrass) Finalize ¶
func (s *SysInitGrass) Finalize(world *ecs.World)
Finalize the system
func (*SysInitGrass) Initialize ¶
func (s *SysInitGrass) Initialize(world *ecs.World)
Initialize the system
type SysMetabolism ¶
type SysMetabolism struct { RateGrazing float32 RateSearching float32 // contains filtered or unexported fields }
SysMetabolism is a system that reduces the energy of grazers due to metabolism.
func (*SysMetabolism) Finalize ¶
func (s *SysMetabolism) Finalize(world *ecs.World)
Finalize the system
func (*SysMetabolism) Initialize ¶
func (s *SysMetabolism) Initialize(world *ecs.World)
Initialize the system
type SysMortality ¶
type SysMortality struct { MaxAge int64 // contains filtered or unexported fields }
SysMortality is a system that removes entities with energy below zero.
func (*SysMortality) Finalize ¶
func (s *SysMortality) Finalize(world *ecs.World)
Finalize the system
func (*SysMortality) Initialize ¶
func (s *SysMortality) Initialize(world *ecs.World)
Initialize the system
type SysReproduction ¶
type SysReproduction struct { MatingTrials int MaxMatingDist int MaxMatingDiff uint8 CrossProb float32 MutationProbability float32 MutationMagnitude float32 AllowAsexual bool HatchRadius float32 // contains filtered or unexported fields }
SysReproduction is a system that handles reproduction of grazers.
func (*SysReproduction) Finalize ¶
func (s *SysReproduction) Finalize(world *ecs.World)
Finalize the system
func (*SysReproduction) Initialize ¶
func (s *SysReproduction) Initialize(world *ecs.World)
Initialize the system
func (*SysReproduction) Update ¶
func (s *SysReproduction) Update(world *ecs.World)
Update the system
type SysSearching ¶
type SysSearching struct { MaxSpeed float32 // contains filtered or unexported fields }
SysSearching is a system to move around searching entities.
func (*SysSearching) Finalize ¶
func (s *SysSearching) Finalize(world *ecs.World)
Finalize the system
func (*SysSearching) Initialize ¶
func (s *SysSearching) Initialize(world *ecs.World)
Initialize the system
type UISysDrawEntities ¶
type UISysDrawEntities struct {
// contains filtered or unexported fields
}
UISysDrawEntities is a system that draws entities as white pixels on an [Image] resource.
func (*UISysDrawEntities) FinalizeUI ¶
func (s *UISysDrawEntities) FinalizeUI(world *ecs.World)
FinalizeUI the system
func (*UISysDrawEntities) InitializeUI ¶
func (s *UISysDrawEntities) InitializeUI(world *ecs.World)
InitializeUI the system
func (*UISysDrawEntities) PostUpdateUI ¶
func (s *UISysDrawEntities) PostUpdateUI(world *ecs.World)
PostUpdateUI the system
func (*UISysDrawEntities) UpdateUI ¶
func (s *UISysDrawEntities) UpdateUI(world *ecs.World)
UpdateUI the system
type UISysDrawGrass ¶
type UISysDrawGrass struct {
// contains filtered or unexported fields
}
UISysDrawGrass is a system that draws the Grass resource.
func (*UISysDrawGrass) FinalizeUI ¶
func (s *UISysDrawGrass) FinalizeUI(world *ecs.World)
FinalizeUI the system
func (*UISysDrawGrass) InitializeUI ¶
func (s *UISysDrawGrass) InitializeUI(world *ecs.World)
InitializeUI the system
func (*UISysDrawGrass) PostUpdateUI ¶
func (s *UISysDrawGrass) PostUpdateUI(world *ecs.World)
PostUpdateUI the system
func (*UISysDrawGrass) UpdateUI ¶
func (s *UISysDrawGrass) UpdateUI(world *ecs.World)
UpdateUI the system
type UISysDrawScatter ¶
type UISysDrawScatter struct { Interval int IntervalOffset int XIndex int YIndex int ImageOffset image.Point Width int Height int // contains filtered or unexported fields }
UISysDrawScatter is a system that draws a scatter plot of entity [Genes].
func (*UISysDrawScatter) FinalizeUI ¶
func (s *UISysDrawScatter) FinalizeUI(world *ecs.World)
FinalizeUI the system
func (*UISysDrawScatter) InitializeUI ¶
func (s *UISysDrawScatter) InitializeUI(world *ecs.World)
InitializeUI the system
func (*UISysDrawScatter) PostUpdateUI ¶
func (s *UISysDrawScatter) PostUpdateUI(world *ecs.World)
PostUpdateUI the system
func (*UISysDrawScatter) UpdateUI ¶
func (s *UISysDrawScatter) UpdateUI(world *ecs.World)
UpdateUI the system
type UISysManagePause ¶
type UISysManagePause struct {
// contains filtered or unexported fields
}
UISysManagePause is a simple system that transfers the pause state from the common.PauseMouseListener resource to the model's model.Systems.
func (*UISysManagePause) FinalizeUI ¶
func (s *UISysManagePause) FinalizeUI(world *ecs.World)
FinalizeUI the system
func (*UISysManagePause) InitializeUI ¶
func (s *UISysManagePause) InitializeUI(world *ecs.World)
InitializeUI the system
func (*UISysManagePause) PostUpdateUI ¶
func (s *UISysManagePause) PostUpdateUI(world *ecs.World)
PostUpdateUI the system
func (*UISysManagePause) UpdateUI ¶
func (s *UISysManagePause) UpdateUI(world *ecs.World)
UpdateUI the system
Source Files ¶
- components.go
- doc.go
- resources.go
- run.go
- sys_decisions.go
- sys_disturbance.go
- sys_draw_entities.go
- sys_draw_grass.go
- sys_draw_scatter.go
- sys_grazing.go
- sys_grow_grass_linear.go
- sys_grow_grass_logistic.go
- sys_init_entities.go
- sys_init_grass.go
- sys_metabolism.go
- sys_mortality.go
- sys_pause.go
- sys_reproduction.go
- sys_searching.go