Skip to content

avemike/simple-natural-selection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oversimplified natural selection

⚠ Warning Project is currently under development

Documentation

Packages

  • animals
    • all animal species inheriting from the Animal.
  • interfaces
  • models
    • animal package - parts of animal aggregated inside Animal class.
      • Attributes - contains all animal general attributes.
      • Needs - contains animal attributes and methods related to fulfilling its needs (e.g. hunger) and searching for goals (e.g. searchForGoal).
      • Movement - contains animal methods related to movement on the map: in specific direction or position.
      • Interaction - contains animal methods related to animal behaviour and interaction with environment.
    • Animal - parent of every animal specie.
    • Plant - parent of every plant specie.
    • GraphicalRepresentative - describes instances that can be rendered.
    • Representative - describes material/physical instances on map.
    • Spatial - describes instances with position on map.
  • plants
    • all plant species inheriting from the Plant.
  • services
    • Config - static class designed for reading .properties files inside configs directory.
  • terrain - controls map
  • ui
  • utils

Ideas for expansion

  • split size parameter into two: render_size and interaction_size.
  • implement water need:
    • create non-paintableand durable spots aligned to border of each water field (let's say 10px spacing)
    • these spots would be water resources
  • render instances with higher coords.y first

Design patterns

Used

  • Factory method: for example Foxes and Rabbits are being created by static create factory method
  • Facade: for example Simulation class takes advantage of a previously created facade. To make simulation work it uses only three methods, so whole complex system is hidden inside it all.
  • Singleton: for example Simulation class, which is designed to have only one active instance.

To implement

  • Adapter: just to make Plant and Animal to collaborate in some scenarios. Instead of writing semi-duplicated code Adapter can be used.

Naming

  • classes: UpperCamelCase
  • methods: lowerCamelCase
  • variables: snake_case

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published