Giter Club home page Giter Club logo

evolution-agh's Introduction

Evolution

This project is developed by congard within the subject of Object Orientated Programming at the AGH University of Science and Technology.

Project description: apohllo/obiektowe-lab/proj1

Technology: Java 17 (simulation), Kotlin (JavaFX GUI)

Libraries used:

Hints

  • Use the mouse wheel (or touchpad) to zoom in/out the map
  • Right-click a cell to show its info (and the objects in it)
  • You can resize border panes with mouse
  • Some params can be changed during simulation
  • Pin the animal you want to observe
  • Cells pane: double-click an animal to see its info

Screenshots

StartScreen

WorldWidget

GenotypeStatsBorderPane

StatsBorderPane

CellsBorderPane

AnimalsBorderPane

WorldWidget_scale

Notes

  • On Linux you may need to add -Dprism.forceGPU=true JVM option to improve GUI performance

TODO

simulation

  • Params
    • Export to JSON
    • Import from JSON
  • Vector2d
  • WeightedRandom
  • Orientation
  • Gene
  • Genotype
    • static Genotype mix(Genotype left, Genotype right, float pos)
  • WorldCell
  • AbstractWorld
    • Statistics to CSV
    • synchronized void update()
      • Generate new grass
    • synchronized void forEachCell
    • elements: List<List<List<WorldAbstractElement>>>
    • deadAnimals: LinkedList<Animal>
    • aliveAnimals: HashSet<Animal>
    • synchronized void forEachAlive
    • synchronized void forEachDead
    • calcAvgLifespan() - for dead
    • aliveAnimalsCount
    • plantsCount
    • freeFieldsCount
    • avgEnergy - for alive
    • day - day number
    • long nextId()
    • void add(WorldAbstractElement)
    • void remove(WorldAbstractElement)
  • RoundWorld
  • PortalWorld
  • WorldElementType
  • WorldAbstractElement
    • pos: Vector2d
    • world: AbstractWorld
    • type: WorldElementType
    • void remove()
  • Plant
    • nutritionalValue: Float
  • Animal
    • eat(Plant)
    • isWellFed()
    • live() - must be called by SimulationEngine every 'day'
    • orientation: Orientation
    • children: LinkedList<Animal>
    • parents: Animal[2]
    • health: Float
    • birthday: Int - day number
    • deathday: Int - -1 if alive
    • eatenPlantsCount: Int
    • genotype: Genotype
    • id: long
    • boolean isAlive()
    • static Animal reproduce(Animal p1, Animal p2)
  • OnTickListener : one tick - one day
  • ErrorHandler
  • SimulationEngine
    • void start()
    • void pause()
    • void stop()
    • AbstractWorld getWorld()
  • Thread safety
    • Lists read/write

gui

  • StartScreen
    • use reflection for params
    • import params from json file
    • export params to json file
    • enable Scroll for fields
  • EvolutionWindow
    • Record button - record statistics to CSV
    • StatusBar
    • Update gui on onTick
  • WorldWidget
  • borders
    • StatsBorderPane
    • ParamsBorderPane
    • GenotypeStatsBorderPane
      • GenotypePane
    • CellsBorderPane
    • AnimalsBorderPane
  • CSS styles for Alert
  • Tests for math

Disclaimer: I ran out of time, so you might find the code a bit undocumented

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.