+ 5
[ ✿ Challenge ✿ ] - Life simulation
Make any kind of life simulation code. Something that tries to simulate biology in some way. It can be a population, a way to walk or grow, your idea, bacterias, plants, bugs, aliens or mammals ... I made my version to give you an idea, but yours can be very different : Crazy, stupid, magic, useless, amazing, serious, funny, technical, short and simple, long and complicated, visual or not, anything is allowed ! https://code.sololearn.com/cR5F006R2XYE/#py Have fun !
11 Answers
+ 5
Not exactly the solution but fractals are part of nature so I guess this would qualify....😊
https://code.sololearn.com/Wpp3r2ld80h8/?ref=app
+ 2
@Jonathan Pizarra
Well, there are actually many fractals in lifeforms, true. Nice idea !
+ 2
Nice, thanks for the link. I'll watch it right now ! What about posting a short introducing lesson about G.A. in Sololearn ? With a very simple example ?
Is it ok for you to tell (in an understandable way) what you're working on ?
+ 2
Blackwinter gave me good motivation ! (thank you !)
So I've decide to write my firsrt Genetic Algorithm.
Guess what it can do !
We can solve crazy complex problems with G.A.
Mine ? : it writes the pyton code :
print("Hello World")
https://code.sololearn.com/c1588kW12miz/#py
+ 2
This code simulates the impact of an epedemic to the population of a city. In the first lines you can define the start conditions.
https://code.sololearn.com/cYdewRD1001I/?ref=app
+ 2
This program shows the color of flowers at mendel inheritance.
https://code.sololearn.com/cTL42jlzIlVj/?ref=app
+ 2
Understood !
+ 1
@blackwinter
Genetic algorithm is a very good idea. I'm not there yet. Do you have one ?
+ 1
@blackwinter
Thank you, I'll add def mutation() to my code !
What do you mean by np in fast np hard problems ?
Edit : Mutation added !
+ 1
I 've just made a new Genetic Algorithm
https://code.sololearn.com/cXUsWUsBEFur/#py
It produces and evolves a population of genes coding for polynomials, and the goal for those polynomials to get the closest possible to a function (or some points given) on an interval. The example settings are looking for an approximation of sin(x) on [0, pi/2].
Unfortunately it won't even start to do something on the Code Playground, but I posted it so that you can try it on your computer and see how I made it. I tried to comment it as much as I could.
Don't forget to comment !