in ,

connor-brooks / ecosim, Hacker News

connor-brooks / ecosim, Hacker News
                    

        

An ecosystem and evolution simulator

GNU / Linux

  • make
  • gcc
  • libglfw3
  • libglew2.0
  • libglfw3-dev
  • libglew-dev
  • ffplay (optional)
  • python3 (optional)
  • matplotlib (optional)

(How To Use)

Install dependencies

$ sudo apt-get install libglfw3 libglew2.0 libglfw3-dev libglew-dev ffmpeg

Grab the code:

$ git clone https://github.com/connor-brooks/ecosim.git

  • However, it is important to note that there is no one-size-fits-all perfect agent. For a well functioning ecosystem to exist, balance is essential. For example: the existence of carnivores is essential to the existence of the herbivores in order to prevent overpopulation, which would result in mass-starvation and extinction of the herbivores.

    Traits in detail

    (Metabolic rate)

    The metabolic rate is the rate which an agent transforms stored energy into kinetic energy. This has both pros and cons. Being able to move around the environment faster allows agents to consume food faster, but also causes the agent to eat more frequently.

    This trait dictates how far an agent can sense other entities. A larger vision range is generally beneficial. However, this trait has some minor downfalls, especially for herbivorous agents. For example: hypersensitivity to other agents causes fleeing from non-dangerous situations, which in turn results in reduced ability to consume.

    Rebirth rate controls how much energy is stored within an agent before splitting (asexual reproduction) occurs. This is especially useful for agents with low metabolism, as it allows them to navigate the environment for a longer time without depleting their energy.

    Dietary preference

    Tweaking the simulation

    Ecosim provides a way to configure the mechanics of the simulation via editing the (config.h) file. The process of doing so is as follows:

    Enter the

  • src directory
  • Edit the config.h file with the text editor of your choice
  • Run make clean

    Run make

    What to change

    This is entirely down to personal preference, however, most people will only be concerned with two sections of the configuration: The general agent settings, and the agent DNA settings.

    In order to use the population / trait logger, change the LOGGER_ENABLE setting to 1 , recompile, and run:

    ./ ecosim_with_log.sh

    Note, python3 and matplotlib is required in order to plot logged data.

    Main world settings

  • DEV_AGENT_COUNT
  • - The amount of agents to spawn when the simulation runs
  • DEV_GAME_FPS - Frames per second (FPS) of the simulation
  • DEV_GAME_FOOD_SPAWN_FREQ - How often (in seconds) to spawn food
  • DEV_GAME_FOOD_SPAWN_INIT - How many items of food to spawn when the simulation runs
  • DEV_GAME_FOOD_SPAWN_MAX / DEV_GAME_FOOD_SPAWN_MIN - The maximum and minimum amount of food that is spawned each food spawn
  • DEV_GAME_FOOD_ENERGY - The amount of energy a piece of food provides when consumed

    Agent general settings

    AGENT_RGB_ALPHA

  • - Transparency of agent's inner cell
  • AGENT_VIS_ALPHA - Transparaney of agent's vision field
  • AGENT_MAX_VELOCITY / AGENT_MIN_VELOCITY - Agent velocity maximum / minimum
  • AGENT_ENERGY_DEFAULT - Default energy of agents spawned at startup
  • (AGENT_METAB_ENERGY_SCALE) x) - The rate of which energy is burned over time, with respect to the metabolic rate of an agent ( where x is metabolism)
  • AGENT_ENERGY_SIZE_SCALE x) - How large an agent is, with respect to their energy (where x is energy)
  • AGENT_MAX_SPEED - The maximum speed any agent can move
  • AGENT_ENERGY_DEAD
  • - The energy level which an agent dies
  • AGENT_TIME_FACTOR - How fast the process of ageing occurs
  • AGENT_DIET_BOUNDARY - Herbivore / Carnivore boundary

    AGENT_DNA_MUTATE_RATE - The maximum amount a trait can change if mutation occurs

  • AGENT_METAB_MAX / AGENT_METAB_MIN - The maximum and minimum metabolic rates allowed
  • AGENT_VISION_MAX / AGENT_VISION_MIN - The maximum and minimum vision field sizes allowed
  • AGENT_REBIRTH_MAX / AGENT_REBIRTH_MIN - The maximum and minimum amount of energy stored in an agent before splitting occurs

    AGENT_DIET_MAX / AGENT_DIET_MIN - The maximum and minimum diet values ​​allowed

  • AGENT_FLOCK_MAX / AGENT_FLOCK_MIN - The maximum and minimum influence flocking has on agents
  • AGENT_WOBBLE_MAX / AGENT_WOBBLE_MIN - The maximum and minimum amount an agent can wobble per second

    INPUT_SPAWN_DELAY

  • - How often to respawn agents when the mouse is held down

    INPUT_SCROLL_AMT - Input sensitivity (Effects scroll and zoom)

    (LOGGER_ENABLE - Enable / disable logging

  • (LOGGER_FILE) - Filename to log to
  • (LOGGER_FREQ) - Logging sample rate

    If you'd like some background noise to play whilst running the simulation, install ffmpeg, otherwise it's not required

  • Read More

    What do you think?

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    GIPHY App Key not set. Please check settings

    Trump Is Setting up Mike Pence to Be The Fall Guy for the Coronavirus, Crypto Coins News

    Trump Is Setting up Mike Pence to Be The Fall Guy for the Coronavirus, Crypto Coins News

    Facebook is suing OneAudience for improperly harvesting user data, Recode

    Facebook is suing OneAudience for improperly harvesting user data, Recode