Git Product home page Git Product logo

critterevolution's Introduction

Critterevolution

A simple simulation of evolving creatures

critterevolution screenshot

Critterevolution simulates an environment where randomly generated creatures (called Critters) swim trying to remain healty and made. Each generation, only the fittest survive and have a chance to pass its genes to its breed.

Rules

Each Critter is defined by a peculiar movement composed by three trigonometric functions that alternate to generate a path. Each step the Critter loses some energy according to how much it has moved. If the Critters crosses a food (greed dots), it eats it and gains energy. It it crosses another Critter, they can mate and generate a new Critter.

To be able to mate, a Critter:

  • Must not have bred already
  • Must have a minimum amount of energy
  • Must not be "too young" or "too old"

When two Critters mate, the spawned breed randomly inherits each properties from either the parents.

Some movement strategies are more effective than others. The more the Critter moves around, the more it has chances to find food and meet mates, but if it moves too fast and in a small area, it consumes a lot of energy to roam in an area that may not provide food.

Critters live a fixed number of cycles.

Configuration

The simulation parameters can be set in a conf file located in the same directory of the program.

Sample conf file:

health    = 300
age       = 2000
critters  = 20
foods     = 200
foodpower = 400

health is the the mimum energy required by a Critter to be able to mate age is the lifespan of the Critters critters is the number of initial Critters foods is the number of Foods available in the simulation foodpower is the amount of energy provided by each Food

Building

Critterevolution consists of a single C++11 file. It depends on the SFML.

critterevolution's People

Contributors

pistacchio avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

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.