Register to reply

Which language to use for evolution simulation

Share this thread:
Kenny Bala
#1
Feb2-14, 09:47 AM
P: 22
Hi guys, my friend and i are planning on creating an evolution simulation. We are however, trying to balance between the amount of time to write code and the amount of time our simulation will take to run, and how fast it runs(the simulation is in real time). So, what programming language do you guys think we should use?
Phys.Org News Partner Science news on Phys.org
NASA team lays plans to observe new worlds
IHEP in China has ambitions for Higgs factory
Spinach could lead to alternative energy more powerful than Popeye
.Scott
#2
Feb2-14, 03:13 PM
P: 540
I would use C++.

There is no trade offs here. There is more "design" in this project than implementation. If you can successfully design the logic, then you should be able to implement it in any modern development environment with any modern language.

So pick a compiled language that you are comfortable with. If you're not comfortable with any compiled language, this is a big enough development project to adopt one.

Modern compilers are efficient enough, especially in optimizing mode (for the final "release") that there is no reason to go to assembler. I would also advise against Forth - unless you already love Forth.
jedishrfu
#3
Feb2-14, 03:36 PM
P: 2,773
if your sim requires a fair amount of graphics then you could use Java. Java has the added advantage of easy portability across platforms like windows to linux to maxosx...

It you're new to programming then you could check out Processing.org and its extensive Java based IDE and Open GL graphics. The IDe was designed for casual programmers and graphic artists who wanted to create interactive art using programming. The Procesing model of a setup() that is run once and a draw() method that is called repeatedly lends itself to evolutionary sims design. Processing also has an export feature for windows, linux and macosx platform executables as well as an android development feature for android sideloading and a javascript development feature for web applications. Processing comes with numerous examples and online support and did I mentions its FREE.

Lastly, if your sim requires numerically solving differential eqns then you should look at the Open Source Physics to see if you can leverage its library and displays to create your sim. (www.compadre.org/osp

Kenny Bala
#4
Feb2-14, 08:56 PM
P: 22
Which language to use for evolution simulation

Thank you for the advice jedishrfu and .Scott. Java was a language both me any my friend were leaning towards since we have experience with the language, and for now it seems like that is the one we will use, although we are still in the elementary planning stages.
DrZoidberg
#5
Feb4-14, 03:20 PM
P: 385
The wikipedia site about genetic programming suggests lisp because it's a tree based language.
So you could for example use clojure - a lisp dialect for the java virtual machine - because that would make it very easy to write a program that generates programs and compiles them on the fly.
So basically your program generates different pieces of code representing the different individuals in your world and then compiles all of that to machine code and runs it, all without actually starting a new program. The newly compiled code is injected into the program at runtime.
jedishrfu
#6
Feb4-14, 04:37 PM
P: 2,773
Quote Quote by DrZoidberg View Post
The wikipedia site about genetic programming suggests lisp because it's a tree based language.
So you could for example use clojure - a lisp dialect for the java virtual machine - because that would make it very easy to write a program that generates programs and compiles them on the fly.
So basically your program generates different pieces of code representing the different individuals in your world and then compiles all of that to machine code and runs it, all without actually starting a new program. The newly compiled code is injected into the program at runtime.
There are also many java genetic algorithm implementations as well.

JGAP framework has been used in some implementations:

http://jgap.sourceforge.net/

Of course, the beauty of clojure is that it can call upon java libraries to accomplish its task and its functional based.

Some other alternatives also would be groovy (java superset with closures) and scala (better java than java but scala language changes between versions may adversely affect your code as its still a work in progress). Both of these use the jvm and java libraries although for scala you need to think a bit differently as its more expressive.
Borek
#7
Feb5-14, 02:56 AM
Admin
Borek's Avatar
P: 23,363
C++: http://www.bpp.com.pl/bitozoa2/bitozoa2.html


Register to reply

Related Discussions
Interesting simulation of a spiral galaxy evolution. Astronomy & Astrophysics 5
Oddball question about linguistics wrt evolution of language Social Sciences 7
Ecosystematic Evolution (symbiosis in the importance of evolution) Biology 5
Evolution and language History & Humanities 13
There are only two primary languages: natural language and mathematical language General Discussion 17