EcoSim | simple biological simulation ran at a massive scale
kandi X-RAY | EcoSim Summary
kandi X-RAY | EcoSim Summary
EcoSim is a simple biological simulation ran at a massive scale. The simulation uses cellular automata to model creatures living in a 2D grid world. The model is comprised of plants and bacteria. Plants grow by harvesting sunlight and are able to reproduce into empty neighboring cells when they reach a specific energy level. Conversely, bacteria can move freely between empty cells in search of plants to eat. If bacteria find a steady source of plant food they can reproduce and flourish; if they do not find plant food within a certain amount of time they die. These simple axiomatic rules have the ability to produce complex ecosystems that are cyclical and self-balancing—it’s also a great way to demonstrate the power of the GPU for a certain class of computational problems.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of EcoSim
EcoSim Key Features
EcoSim Examples and Code Snippets
Community Discussions
Trending Discussions on EcoSim
QUESTION
I followed a PyGame tile-based tutorial for a project in school, but I never intended to make a game, but a simulation of an ecosystem. Unfortunately, when I run my program the performance is very bad and it only manages to run for a few seconds, before the windows to stop answering.
The only thing I want to do at the moment is to place a new patch of grass, when the energy of a grass patch reaches 80.
What is there to do? Is it bad that everything is inside of the update method? Can I use events or something to make the checks happen with a greater interval? I know there is a lot of maths going on each frame, but don't know how to do it another way.
Here is my code:
main.py:
...ANSWER
Answered 2020-Oct-21 at 12:13The major issue is the method Sim.new_grass
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install EcoSim
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page