CARVIEW |
Every repository with this icon (

Every repository with this icon (

Description: | Pythonic framework for working with simulations. edit |
Homepage: | edit |
Public Clone URL: |
git://github.com/cool-RR/GarlicSim-for-Python-2.6.git
Give this clone URL to anyone.
git clone git://github.com/cool-RR/GarlicSim-for-Python-2.6.git
|
Your Clone URL: |
Use this clone URL yourself.
git clone git@github.com:cool-RR/GarlicSim-for-Python-2.6.git
|
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Sun Aug 16 07:33:07 -0700 2009 | Dizzy... I want mommy. [cool-RR] |
![]() |
README.markdown | Sat Nov 07 15:08:05 -0800 2009 | - [cool-RR] |
![]() |
garlicsim.wpr | Sat Oct 24 12:54:33 -0700 2009 | - [unknown] |
![]() |
garlicsim/ | Thu Nov 05 17:12:39 -0800 2009 | - [cool-RR] |
![]() |
garlicsim_wx/ | Tue Nov 03 19:43:30 -0800 2009 | warehouse [cool-RR] |
![]() |
images worktable/ | Tue Aug 25 07:32:16 -0700 2009 | Added screenshot [cool-RR] |
![]() |
run_gui.py | Sat Oct 31 12:30:37 -0700 2009 | - [cool-RR] |
How to run
Run run_gui.py
in the root folder to launch the GUI. Then, File -> New. Choose one of the simulation packages, press Ok. A dialog will pop up, press Ok. Double click the seek bar to toggle playing.
Requires:
- Python 2.6 (Scroll down to the "Python versions" section for other versions.)
Optional:
- Psyco
- on Windows only: Python for Windows Extensions
Gui requires:
- wxPython (Not needed for non-gui usage.)
What is GarlicSim?
GarlicSim is an ambitious open-source project in the field of scientific computing, specifically computer simulations. It attempts to redefine the way that people think about computer simulations, making a new standard for how simulations are created and used.
GarlicSim is a platform for writing, running and analyzing simulations. It is general enough to handle any kind of simulation: Physics, game theory, epidemic spread, electronics, etc.
When you're writing a simulation, about 90% of the code you write is boilerplate; Code that isn't directly related to the phenomenon you're simulating, but is necessary for your simulation to work. The aim of GarlicSim is to write that 90% of the code once and for all, and to do it well, so you could concentrate on the important 10%.
GarlicSim defines a new format for simulations. It's called a simulation package, and often abbreviated as simpack. For example, say you are interested in simulating the interaction of hurricane storms. It is up to you to write a simpack for this type of simulation. The simpack is simply a Python package which defines a few special functions according to the GarlicSim simpack API, the most important function being the step function.
The beauty is that since so many simulation types can fit into this mold of a simpack, the tools that GarlicSim provides can be used across all of these different domains. Once you plug your own simpack into GarlicSim, you're ready to roll. All the tools that GarlicSim provides will work with your simulation.
Additionally, GarlicSim will eventually be shipped with a standard library of simpacks for common simulations, that the user may find useful to use as-is, or with his own modifications.
For a more thorough introduction to how GarlicSim works, check out the Introduction to GarlicSim - Though not yet complete, it goes deep into the principles of GarlicSim and how to work with it.
GarlicSim itself is written in pure Python. The speed of simulations is mostly dependent on the simpack's performance - So it is possible to use C code in a simpack to make things faster.
Current screenshot, showing the Game of Life simulation package shipped with the program:
Mockup:
Core and GUI
This repository contains two packages, garlicsim
, which is the core logic, and garlicsim_wx
, which is the wxPython-based GUI.
The garlicsim
package is the important one, and its code is well-organized and very readable. It is distributed under the LGPL2.1 license.
garlicsim_wx
is in a far less mature state than garlicsim
. Also, it is not licensed as open source. (Though the source code is available and not obfuscated.) I have not yet decided if the gui will be developed as an open source project or as commercial software, so in the meantime it is officially closed source.
Both packages are copyright 2009 Ram Rachum.
Python versions
GarlicSim has official support for 4 different versions of Python. For each of these versions there is a separate fork. The fork for Python 2.6 is the main fork, on which most development is done. Some of the other forks have slightly reduced functionality, described here:
GarlicSim for Python 2.4 - Does not support multiprocessing, only multithreading.
GarlicSim for Python 2.5 - Requires backported multiprocessing package to be installed in order to use multiprocessing.
GarlicSim for Python 2.6 - Main fork, contains all the functionality.
GarlicSim for Python 3.1 - Does not contain gui package, since wxPython doesn't yet support Python 3.x.
Frequently asked questions:
What kind of simulations will I be able to do with GarlicSim?
People often ask this; probably because they do not fully believe it when they read GarlicSim's description saying that it can handle any kind of simulation. Well, it can. It is very general.
Then people ask, if it is so general, how is it useful? There are two answers to that:
It is very useful. There are many many features that are common to all kinds of simulations, and which you really don't want to spend time writing. A few examples of such features: Saving the simulation to file. Browsing the timeline of a simulation like a movie clip while it is still crunching in the background. The option to make manual changes to the simulation world, observe their effects on how the simulation unfolds, and then to be able to revert to the timeline in which the changes were not applied. Changing the arguments to the step function on the fly, etc.
If you are interested in only a specific subset of simulations -- say, simulations of solid bodies in Physics -- Then it will be the wisest to write a framework for that within the framework of GarlicSim. Indeed, part of the work on GarlicSim will include writing these kind of sub-frameworks for the common categories of simulations (e.g., a framework for physics, a framework for game theory, etcetera.)
Does GarlicSim give mathematical tools for simulations?
No. GarlicSim doesn't contain any mathematical tools, or any algorithms to be used in simulations. These things are related to the content of the simulation, which is none of GarlicSim's business. GarlicSim handles the organization, or "bureaucracy" of the simulation, so you can concentrate on the content. If you need mathematical tools for your simulation there are many Python projects that provide them, and you may use them in your simpack that you run with GarlicSim.