Which language to use for evolution simulation

Click For Summary
SUMMARY

The discussion centers on selecting a programming language for developing an evolution simulation. C++ is recommended for its performance and design capabilities, while Java is suggested for its portability and extensive libraries, particularly for graphics. Processing.org is highlighted as an excellent tool for beginners, offering a user-friendly IDE and support for interactive graphics. Additionally, Clojure, a Lisp dialect for the Java Virtual Machine, is noted for its ability to generate and compile code dynamically, making it suitable for evolutionary simulations.

PREREQUISITES
  • Understanding of compiled languages, particularly C++ and Java
  • Familiarity with Processing.org for graphics programming
  • Knowledge of genetic algorithms and their implementations
  • Basic concepts of dynamic code generation in Clojure
NEXT STEPS
  • Explore the Processing.org IDE for interactive graphics development
  • Research the JGAP framework for genetic algorithm implementations in Java
  • Learn about Clojure and its capabilities for dynamic code generation
  • Investigate Open Source Physics for numerical solutions in simulations
USEFUL FOR

Developers interested in creating evolutionary simulations, programmers looking to enhance their skills in C++, Java, or Clojure, and anyone exploring genetic algorithms and interactive graphics.

Kenny Bala
Messages
28
Reaction score
0
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?
 
Technology news on Phys.org
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.
 
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
 
Last edited:
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.
 
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.
 
DrZoidberg said:
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.
 

Similar threads

Replies
1
Views
2K
Replies
10
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
9
Views
3K
Replies
38
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
7K
Replies
3
Views
2K