Documentation ¶
Overview ¶
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2024 Sebastian Kroczek <me@xbug.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- Variables
- func PutMarking(m *Marking)
- func ToAntRange(a ant.Level) float64
- type AntAttack
- type AntEnergy
- type AntHill
- type AntLoad
- type AntOS
- func (a *AntOS) Collides() ([2]float64, [2]float64, SearchIter)
- func (a *AntOS) Draw(screen *ebiten.Image)
- func (a *AntOS) GetCurrentLoad() int
- func (a *AntOS) GetDirectionToSugar(sugar ant.Sugar) int
- func (a *AntOS) GetId() int
- func (a *AntOS) GetRole() string
- func (a *AntOS) GoForward(steps int)
- func (a *AntOS) GoForwards()
- func (a *AntOS) GoToSugar(sugar ant.Sugar)
- func (a *AntOS) GotToAntHill()
- func (a *AntOS) Init(ant interface{})
- func (a *AntOS) IsInitialized() bool
- func (a *AntOS) See() ([2]float64, [2]float64, SearchIter)
- func (a *AntOS) SetMark(radius, information int)
- func (a *AntOS) Smell() ([2]float64, [2]float64, SearchIter)
- func (a *AntOS) TakeSugar(sugar ant.Sugar) error
- func (a *AntOS) Turn(direction int)
- func (a *AntOS) Update()
- type AntOSConstructor
- type AntOSMoving
- type AntOSState
- type AntOptions
- type AntRange
- type AntRotation
- type AntSpeed
- type AntVision
- type Apple
- type Bounds
- type Box
- type GameObject
- type Marking
- type Properties
- type RTreeG
- func (r *RTreeG[T]) Clear()
- func (r *RTreeG[T]) Copy() *RTreeG[T]
- func (r *RTreeG[T]) Delete(min, max [2]float64, value T)
- func (r *RTreeG[T]) Insert(min, max [2]float64, value T)
- func (r *RTreeG[T]) Len() int
- func (r *RTreeG[T]) Nearby(algo func(min, max [2]float64, data T, item bool) (dist float64), ...)
- func (r *RTreeG[T]) Replace(oldMin, oldMax [2]float64, oldData T, newMin, newMax [2]float64, newData T)
- func (r *RTreeG[T]) Scan(iter func(min, max [2]float64, data T) bool)
- func (r *RTreeG[T]) Search(min, max [2]float64, iter func(min, max [2]float64, data T) bool)
- type SearchIter
- type Simulation
- func (s *Simulation) AddMarking(m *Marking)
- func (s *Simulation) AddMarkingAtPosition(position orb.Point, radius int, information int)
- func (s *Simulation) AddNewAnt()
- func (s *Simulation) Draw(screen *ebiten.Image)
- func (s *Simulation) FlushMarkingChanges()
- func (s *Simulation) Layout(_, _ int) (int, int)
- func (s *Simulation) RemoveAnt(ant *AntOS)
- func (s *Simulation) RemoveMarking(m *Marking)
- func (s *Simulation) RemoveSugar(sugar *Sugar)
- func (s *Simulation) Update() error
- type SimulationConfig
- type SimulationOptions
- type Sugar
Constants ¶
const ( DecreasedSpeed AntSpeed = 3 DefaultSpeed = 4 IncreasedSpeed = 5 BoostedSpeed = 6 )
const ( DecreasedRotation AntRotation = 6 DefaultRotation = 8 IncreasedRotation = 12 BoostedRotation = 16 )
const ( DecreasedLoad AntLoad = 4 DefaultLoad = 5 IncreasedLoad = 7 BoostedLoad = 10 )
const ( DecreasedVision AntVision = 45 DefaultVision = 60 IncreasedVision = 75 BoostedVision = 90 )
const ( DecreasedRange AntRange = 0.75 DefaultRange = 1.0 IncreasedRange = 1.5 BoostedRange = 2 )
const ( DecreasedEnergy AntEnergy = 50 DefaultEnergy = 100 IncreasedEnergy = 175 BoostedEnergy = 250 )
const ( DecreasedAttack AntAttack = 0 DefaultAttack = 10 IncreasedAttack = 20 BoostedAttack = 30 )
Variables ¶
var MarkCache = markCache{}
Functions ¶
func PutMarking ¶
func PutMarking(m *Marking)
func ToAntRange ¶
Types ¶
type AntHill ¶
type AntHill struct { resources.AnimatedSprite CurrentSugar int // contains filtered or unexported fields }
func NewRandomAntHill ¶
type AntOS ¶
type AntOS struct { resources.AnimatedSprite Target interface{} CurrentDirection float64 // in degrees State AntOSState CurrentSugarLoad int Properties SetMarkThreshold int SetMarkResetTime int // contains filtered or unexported fields }
func NewAntOS ¶
func NewAntOS(simulation *Simulation, options ...AntOptions) *AntOS
func (*AntOS) GetCurrentLoad ¶
func (*AntOS) GoForwards ¶
func (a *AntOS) GoForwards()
func (*AntOS) GotToAntHill ¶
func (a *AntOS) GotToAntHill()
func (*AntOS) IsInitialized ¶
type AntOSConstructor ¶
type AntOSConstructor func(AntOptions) *AntOS
type AntOSMoving ¶
type AntOSMoving struct { TargetDirection *float64 // The direction the Ant should move to in degrees Steps *int // The number of steps the Ant should take }
func (*AntOSMoving) Update ¶
func (a *AntOSMoving) Update(os *AntOS)
type AntOSState ¶
type AntOSState interface {
Update(os *AntOS)
}
type AntOptions ¶
type AntOptions func(*AntOS)
func WithAntHill ¶
func WithAntHill(antHill *AntHill) AntOptions
func WithPosition ¶
func WithPosition(x, y float64) AntOptions
func WithRole ¶
func WithRole(role string, properties Properties) AntOptions
type AntRotation ¶
type AntRotation int
AntRotation Adjustments for rotation
func ToAntRotation ¶
func ToAntRotation(a ant.Level) AntRotation
type Apple ¶
type Apple struct { resources.AnimatedSprite // contains filtered or unexported fields }
func NewRandomApple ¶
type GameObject ¶
type Marking ¶
type Marking struct { Position orb.Point Radius int Information int Lifespan int // contains filtered or unexported fields }
func GetMarking ¶
func GetMarking() *Marking
func NewMarking ¶
func (*Marking) GetInformation ¶
func (*Marking) GetPosition ¶
type Properties ¶
type Properties struct { Speed AntSpeed Rotation AntRotation Load AntLoad Vision AntVision Range int Energy AntEnergy Attack AntAttack }
func ApplyAntRole ¶
func ApplyAntRole(defaultRange float64, role ant.Adjustments) Properties
func NewDefaultProperties ¶
func NewDefaultProperties(defaultRange float64) Properties
type RTreeG ¶
type RTreeG[T any] struct { // contains filtered or unexported fields }
type SearchIter ¶
type SearchIter func(min, max [2]float64, data GameObject) bool
type Simulation ¶
type Simulation struct { RolesCount map[string]int SimulationConfig // contains filtered or unexported fields }
func NewSimulation ¶
func NewSimulation(screenWidth, screenHeight int, cnf SimulationConfig) *Simulation
func (*Simulation) AddMarking ¶
func (s *Simulation) AddMarking(m *Marking)
func (*Simulation) AddMarkingAtPosition ¶
func (s *Simulation) AddMarkingAtPosition(position orb.Point, radius int, information int)
func (*Simulation) AddNewAnt ¶
func (s *Simulation) AddNewAnt()
func (*Simulation) Draw ¶
func (s *Simulation) Draw(screen *ebiten.Image)
func (*Simulation) FlushMarkingChanges ¶
func (s *Simulation) FlushMarkingChanges()
func (*Simulation) RemoveAnt ¶
func (s *Simulation) RemoveAnt(ant *AntOS)
func (*Simulation) RemoveMarking ¶
func (s *Simulation) RemoveMarking(m *Marking)
func (*Simulation) RemoveSugar ¶
func (s *Simulation) RemoveSugar(sugar *Sugar)
func (*Simulation) Update ¶
func (s *Simulation) Update() error
type SimulationConfig ¶
type SimulationConfig struct {
// contains filtered or unexported fields
}
func NewSimulationConfig ¶
func NewSimulationConfig(options ...SimulationOptions) *SimulationConfig
type SimulationOptions ¶
type SimulationOptions func(*SimulationConfig)
func WithAntConstructor ¶
func WithAntConstructor(antConstructor ant.AntConstructor) SimulationOptions
func WithAntDesiredValue ¶
func WithAntDesiredValue(desiredValue int) SimulationOptions
func WithRoles ¶
func WithRoles(roles map[string]Properties, chooseRole ant.ChooseRole) SimulationOptions
func WithSugarDesiredValue ¶
func WithSugarDesiredValue(desiredValue int) SimulationOptions
type Sugar ¶
type Sugar struct { resources.AnimatedSprite gmath.Rect CurrentSugar int // contains filtered or unexported fields }
func NewRandomSugar ¶
func NewRandomSugar(simulation *Simulation, border int) *Sugar