Which language to use for evolution simulation

In summary, when considering a programming language for creating an evolution simulation, there are a few options to consider. C++ is a good choice for its efficiency and modern compilers. Java is also a viable option for its easy portability and graphics capabilities. Processing, a Java-based IDE, is a great tool for beginners with its user-friendly interface and numerous features. Lisp and its dialects, such as Clojure, are recommended for their tree-based structure and ability to generate and compile code at runtime. Other languages like groovy and scala also offer the convenience of using Java libraries, but may require a different approach. Ultimately, the choice should be based on the programmer's comfort and familiarity with the language.
  • #1
Kenny Bala
29
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
  • #2
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.
 
  • #3
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:
  • #4
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.
 
  • #5
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.
 
  • #6
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.
 

1. What programming language is typically used for evolution simulation?

The most commonly used programming language for evolution simulation is Java. Other popular options include Python, C++, and MATLAB.

2. Are there any specific libraries or frameworks for evolution simulation?

Yes, there are several libraries and frameworks specifically designed for evolution simulation, such as Avida, Tierra, and OpenBEAGLE. These tools can help with tasks such as creating populations, generating random mutations, and simulating genetic algorithms.

3. Can I use any programming language for evolution simulation?

In theory, any programming language can be used for evolution simulation. However, some languages may have better performance or more convenient features for this type of simulation. It is important to choose a language that you are comfortable with and that has the necessary tools for your specific simulation goals.

4. How do I determine which language is best for my evolution simulation project?

The best language for your evolution simulation project will depend on several factors, such as the complexity of your simulation, your programming experience, and the available tools for your chosen language. It is recommended to research and compare different languages and their features before making a decision.

5. Are there any online resources or communities for discussing evolution simulation programming languages?

Yes, there are several online resources and communities for discussing evolution simulation programming languages. Some popular options include forums such as Reddit and Stack Overflow, as well as social media groups and online communities specifically for scientists and programmers interested in evolutionary simulations.

Similar threads

  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
10
Views
3K
  • Programming and Computer Science
Replies
8
Views
875
Replies
3
Views
322
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
889
  • Quantum Physics
Replies
1
Views
771
  • Programming and Computer Science
Replies
4
Views
5K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
9
Views
2K
Back
Top